Optimized lookup table placement and trailing zero words stripping
This commit is contained in:
+5
-5
@@ -12,9 +12,9 @@
|
||||
|
||||
.inc stdlib.nrjasm
|
||||
|
||||
.var x 12EF ; .var defines a label for a particular memory location
|
||||
.var y 12F0 ; define another variable at 0x12F0
|
||||
.set @x 33EE ; .set sets a memory location to a particular hex constant at the build time, @ dereferences a label into the address
|
||||
.var x 2EF ; .var defines a label for a particular memory location
|
||||
.var y 2F0 ; define another variable at 0x2F0
|
||||
.set @x 'm ; .set sets a memory location to a particular hex constant at the build time, @ dereferences a label into the address
|
||||
.set @y 'M ; ' dereferences a character into a whole word with its ASCII code
|
||||
|
||||
; we CANNOT use dereferencing operators with .var, only with .set or directly
|
||||
@@ -28,13 +28,13 @@
|
||||
|
||||
; for the lookup table and CUR/NXT macros to work correctly, the code must start at an address divisible by 3
|
||||
; note that FREE doesn't intelligently detect the available cells, it only takes the next one after the maximum address used
|
||||
; so in our case, the first FREE instance will be substituted with 12F1, the next with 12F2 and so on
|
||||
|
||||
; so in our case, the first FREE instance will be substituted with 2F1, the next with 2F2 and so on
|
||||
|
||||
; now, lets output a character by transferring the y value to the output cell 1
|
||||
; in an endless loop
|
||||
|
||||
.lbl myloop
|
||||
MOV 1 @x
|
||||
MOV 1 @y @myloop ; output the character and jump to the beginning
|
||||
; we don't have to explicitly zero out the cell 1 as it is done by the I/O logic
|
||||
|
||||
|
||||
Reference in New Issue
Block a user