08-22-2011, 01:57 PM
Hi all
I know it's a bit odd to ask this, because the compiler doesn't ask us to learn ASM but...
I'm starting to learn some ASM and besides read some books, I'm trying to get some examples from <!-- m --><a class="postlink" href="http://stu.pido.us/wiki/retrogames:index">http://stu.pido.us/wiki/retrogames:index</a><!-- m --> and <!-- m --><a class="postlink" href="http://members.fortunecity.com/jonathan6/egghead/id2.html">http://members.fortunecity.com/jonathan ... d/id2.html</a><!-- m -->, but every piece of code I try to compile between ASM and END ASM, end with a compiler error, for instance:
...ends with "temp.bor:11: Error: illegal preprocessor character '$'. Compilation failed" And:
...ends with "temp.bor:3: Error: Syntax error. Unexpected token 'LD' [LD]. Compilation failed"
Is there any consideration to use ASM code in the compiler, the code examples are wrong... or have I to use another compiler, like PASMO, to compile ASM?
Thanks in advance and cheers
EDIT: I've just found this post (<!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/bug-reports/illegal-preprocessor-errors-on-some-files-solved-t603.html">bug-reports/illegal-preprocessor-errors-on-some-files-solved-t603.html</a><!-- l -->) but I can't manage to solve it
I know it's a bit odd to ask this, because the compiler doesn't ask us to learn ASM but...
I'm starting to learn some ASM and besides read some books, I'm trying to get some examples from <!-- m --><a class="postlink" href="http://stu.pido.us/wiki/retrogames:index">http://stu.pido.us/wiki/retrogames:index</a><!-- m --> and <!-- m --><a class="postlink" href="http://members.fortunecity.com/jonathan6/egghead/id2.html">http://members.fortunecity.com/jonathan ... d/id2.html</a><!-- m -->, but every piece of code I try to compile between ASM and END ASM, end with a compiler error, for instance:
Code:
ASM
ld a,2 ; upper screen
call 5633 ; open channel
loop ld de,string ; address of string
ld bc,eostr-string ; length of string to print
call 8252 ; print our string
jp loop ; repeat until screen is full
string defb '(your name) is cool'
eostr equ $
END ASM
...ends with "temp.bor:11: Error: illegal preprocessor character '$'. Compilation failed" And:
Code:
ASM
; scroll izquierda
;
ld hl, 22527
ld c, 192
buc_2 ld b, 32
and a
buc_1 rl (hl)
dec hl
djnz buc_1
jr nc, noca_1
ld (var), hl
ld ix, (var)
set o, (ix+32)
noca_1 dec c
jr nz, buc_2
ret
;
; scroll derecha
;
ld hl, 16384
ld c, 192
buc_4 ld b, 32
and a
buc_3 rr (hl)
inc hl
djnz buc_3
jr nc, noca_2
ld (var), hl
ld ix, (var)
set 7, (ix-32)
noca_2 dec c
jr nz, buc_4
ret
var equ 23728
END ASM
...ends with "temp.bor:3: Error: Syntax error. Unexpected token 'LD' [LD]. Compilation failed"
Is there any consideration to use ASM code in the compiler, the code examples are wrong... or have I to use another compiler, like PASMO, to compile ASM?
Thanks in advance and cheers
EDIT: I've just found this post (<!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/bug-reports/illegal-preprocessor-errors-on-some-files-solved-t603.html">bug-reports/illegal-preprocessor-errors-on-some-files-solved-t603.html</a><!-- l -->) but I can't manage to solve it