change LIT assembled code from 01 to 80
This commit is contained in:
parent
ea3179471c
commit
486b9b4d53
|
@ -338,15 +338,15 @@ podemos ver que el ensamblador reporta que nuestro programa es de 5 bytes de tam
|
|||
Assembled bin/hola.rom(5 bytes), 0 labels, 0 macros.
|
||||
```
|
||||
|
||||
para el curioso (¡como tu!), podemos usar una herramienta como hexdump para ver sus contenidos:
|
||||
para el curioso (¡como tú!), podemos usar una herramienta como hexdump para ver sus contenidos:
|
||||
|
||||
```
|
||||
$ hexdump -C bin/hola.rom
|
||||
00000000 01 68 01 18 17 |.h...|
|
||||
00000000 80 68 80 18 17 |.h...|
|
||||
00000005
|
||||
```
|
||||
|
||||
01 es el "opcode" correspondiente a LIT, y 17 es el opcode correspondiente a DEO. ¡y ahí están nuestros 68 y 18!
|
||||
80 es el "opcode" correspondiente a LIT, y 17 es el opcode correspondiente a DEO. ¡y ahí están nuestros 68 y 18!
|
||||
|
||||
¡osea, efectivamente, nuestro programa ensamblado presenta una correspondencia uno a uno con las instrucciones que acabamos de escribir!
|
||||
|
||||
|
@ -355,7 +355,7 @@ de hecho, podríamos haber escrito nuestro programa con estos números hexadecim
|
|||
|
||||
```
|
||||
( hola.tal )
|
||||
|0100 01 68 01 18 17 ( LIT 68 LIT 18 DEO )
|
||||
|0100 80 68 80 18 17 ( LIT 68 LIT 18 DEO )
|
||||
```
|
||||
|
||||
tal vez no sea la manera más práctica de programar, pero ciertamente una divertida :)
|
||||
|
|
|
@ -326,11 +326,11 @@ for the curious (like you!), we could use a tool like hexdump to see its content
|
|||
|
||||
```
|
||||
$ hexdump -C bin/hello.rom
|
||||
00000000 01 68 01 18 17 |.h...|
|
||||
00000000 80 68 80 18 17 |.h...|
|
||||
00000005
|
||||
```
|
||||
|
||||
01 is the "opcode" corresponding to LIT, and 17 is the opcode corresponding to DEO. and there they are our 68 and 18!
|
||||
80 is the "opcode" corresponding to LIT, and 17 is the opcode corresponding to DEO. and there they are our 68 and 18!
|
||||
|
||||
so, effectively, our assembled program matches one-to-one the instructions we just wrote!
|
||||
|
||||
|
@ -338,7 +338,7 @@ actually, we could have written our program with these hexadecimal numbers (the
|
|||
|
||||
```
|
||||
( hello.tal )
|
||||
|0100 01 68 01 18 17 ( LIT 68 LIT 18 DEO )
|
||||
|0100 80 68 80 18 17 ( LIT 68 LIT 18 DEO )
|
||||
```
|
||||
|
||||
maybe not the most practical way of programming, but indeed a fun one :)
|
||||
|
|
Loading…
Reference in New Issue