The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Learning ASM and ZX Basic Compiler
#1
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:

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="https://forum.boriel.com/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 Sad
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)