- Top Stats

Top Posters Top Topic Starters Top Topics
AMSDOS 1290
arnoldemu 1128
TFM 1124
ervin 746
ronaldo 406
AMSDOS 56
arnoldemu 51
ervin 42
EgoTrip 35
Arnaud 33
FutureOS corner - 71829 Views TFM/FS 07:12, 01 October 10
Example Z80 as... - 67200 Views arnoldemu 10:59, 04 April 10
#CPCtelera 1.4... - 33769 Views ronaldo 13:59, 11 May 15
BASIC programm... - 31801 Views arnoldemu 16:23, 22 May 09
CHAMP Assemble... - 25438 Views Bruce Abbo... 12:59, 16 January 14


Author Topic: Rasm Z80 assembler v0.113 [update 2019.04.26]  (Read 23753 times)

0 Members and 1 Guest are viewing this topic.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 867
  • Country: fr
  • Liked: 820
Re: Rasm Z80 assembler v0.83 [update 2018.04.11]
« Reply #100 on: 14:50, 12 April 18 »
Interesting. But for my use case, I think the shift (>>) will be more explicit, in fact!
Targhan/Arkos

Arkos Tracker 2 - alpha 5 now released! - Follow the news on Twitter!
Disark A cross-platform Z80 disassembler/source converter

Imperial Mahjong
Orion Prime

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.84 [update 2018.04.18]
« Reply #101 on: 12:22, 18 April 18 »
update v0.84
- new directives STRUCT and ENDSTRUCT, ENDS to create structures
- fix regression introduced with v0.75 and embedded usage (like Arkos Tracker II does)

Documentation FR updated, EN will follow


Example of structures manipulations

 
Code: [Select]
org #1000

label1

struct st1
ch1 defw 0
ch2 defb 0
endstruct

struct st2
ch1 defb 0
ch2 defw 0
endstruct

label2

assert label1==label2           ; declaring a struct does not change code output
assert st1.ch1<st1              ; declaring a struct is not affected by current output adress
assert st1==st2                 ; size of both structs is equal (NOT recommended vasm syntax)
assert {sizeof}st1=={sizeof}st2 ; explicit size of
assert st1.ch2!=st2.ch2         ; no confusion between struct with identical fields names

struct metast1
struct st1 sub1 ; imbricated structs
struct st2 sub2
endstruct

label3

assert label3==label2 && label3==label1         ; declaring a struct using struct does not change code output
assert metast1.sub1<metast1.sub2                ; check sub-structs are in order
assert metast1.sub1.ch2<metast1.sub2.ch1        ; check sub-structs are not overlapping
assert {sizeof}metast1.sub1=={sizeof}st1        ; can get sizeof in many ways
assert {sizeof}metast1=={sizeof}st1+{sizeof}st2 ; metast1 struct = struct st1+st2
use RASM, the best assembler ever made :p

I will survive

Offline Golem13

  • CPC464
  • **
  • Posts: 28
  • Country: fr
  • Liked: 70
Re: Rasm Z80 assembler v0.84 [update 2018.04.18]
« Reply #102 on: 12:26, 18 April 18 »
Ok ok :P ... That's a fact: I am in love :-* :-*

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.85 [update 2018.04.18]
« Reply #103 on: 23:03, 18 April 18 »
update v0.85
- fix regressions introduced by STRUCT code modifications
- added some checks and error messages

for the record, one of this regression had 1 chance on a billion to occur. Golem13 project wins the ticket!  :laugh:
use RASM, the best assembler ever made :p

I will survive

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #104 on: 15:54, 27 April 18 »
update v0.86
- fix many bugs in label import
- fix multi-nops
- fix automatic extension for primary source
- fix infinite loop when error on reserved keyword in an expression
- shortcuts LD BC/DE/HL,BC/DE/HL (uz80 style)
- UZ80 compatibility option (for new versions of CNG player)


NEW online documentation FR http://www.roudoudou.com/rasm/rasm_fr.html

Still working on online ENglish documentation
« Last Edit: 15:56, 27 April 18 by roudoudou »
use RASM, the best assembler ever made :p

I will survive

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.265
  • Country: au
    • index.php?action=treasury
  • Liked: 933
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #105 on: 07:38, 01 May 18 »
I'm really enjoying using RASM - thanks roudoudou!
Just wondering, is there a way to have multiple commands on one line?

For example, instead of:
Code: [Select]
ld a,#33
ld (hl),a
inc l

Is there a way to do something like this?
Code: [Select]
ld a,#33; ld (hl),a; inc l

[EDIT] I think I found the answer.  ;D 

Code: [Select]
ld a,#33:ld (hl),a:inc l

Now THAT is a great feature!
« Last Edit: 07:47, 01 May 18 by ervin »
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #106 on: 23:19, 05 May 18 »
I updated the z80.vim in order to highlight rasm directives
http://www.roudoudou.com/rasm/z80.vim

But i'm still stuck with literal values...
Sometimes no color, sometimes half color (hex values...)

Code: [Select]
syn match z80Number "\$[\x]\{1,8}"
syn match z80Number "\$"
syn match z80Number "0x[\x]\{1,8}"
syn match z80Number "0b[01]\{1,32}"
syn match z80Number "#[\x]\{1,8}"
syn match z80Number "%[01]\{1,32}"
syn match z80Number "@[\o]\+"
syn match z80Number "[01]\{1,32}b"
syn match z80Number "[\x]\{1,8}h"
syn match z80Number "[0-9\.]\+"
use RASM, the best assembler ever made :p

I will survive

Offline Arnaud

  • Supporter
  • 464 Plus
  • *
  • Posts: 482
  • Country: fr
  • Liked: 380
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #107 on: 10:01, 06 May 18 »
I very nice feature for the C developper could be the possibility to generate a Library compatible SDCC.

Of course i have not idea how difficult could be the task  :P

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #108 on: 10:09, 06 May 18 »
I very nice feature for the C developper could be the possibility to generate a Library compatible SDCC.
Of course i have not idea how difficult could be the task  :P

I guess i have to find the .rel format description?
use RASM, the best assembler ever made :p

I will survive

Offline Arnaud

  • Supporter
  • 464 Plus
  • *
  • Posts: 482
  • Country: fr
  • Liked: 380
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #109 on: 10:26, 06 May 18 »
I guess i have to find the .rel format description?

There's a doc about library in SDCC / SDASsembly (sdcc/src/sdas/doc)

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.265
  • Country: au
    • index.php?action=treasury
  • Liked: 933
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #110 on: 03:09, 11 May 18 »
Quick question about using ORG...

I've got a bunch of code that refers to a jump table.

A trivial example:

Code: [Select]
ORG #9000

LD HL,jumptable
; do some stuff
RET

jumptable:
defw row1,row2,row3,row4
defw row5,row6,row7,row8

I can't figure out how to put the jump table at a specific memory address.
When I try (by putting ORG #9800, for example), I get all sorts of unexpected behaviour.
When I don't have ORG before the jump table, the program behaves correctly.

Is there a way to put the jump table into a specific memory address?

Thanks.
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #111 on: 09:57, 11 May 18 »
Quick question about using ORG...

I've got a bunch of code that refers to a jump table.

A trivial example:

Code: [Select]
ORG #9000

LD HL,jumptable
; do some stuff
RET

jumptable:
defw row1,row2,row3,row4
defw row5,row6,row7,row8

I can't figure out how to put the jump table at a specific memory address.
When I try (by putting ORG #9800, for example), I get all sorts of unexpected behaviour.
When I don't have ORG before the jump table, the program behaves correctly.

Is there a way to put the jump table into a specific memory address?

Thanks.

Could you be more specific?

Code: [Select]
org #9000

ld hl,jumptable

org #9800

jumptable
defw row1,row2,row3

org #A000
row1 nop
row2 nop
row3 nop

is assembled correctly so i guess the error is elsewhere

Code: [Select]
#21 #00 #98
...many zeroes...
#00 #A0 #01 #A0 #02 #A0

for a total of 4099 bytes

use RASM, the best assembler ever made :p

I will survive

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.265
  • Country: au
    • index.php?action=treasury
  • Liked: 933
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #112 on: 10:28, 11 May 18 »
Could you be more specific?

Code: [Select]
org #9000

ld hl,jumptable

org #9800

jumptable
defw row1,row2,row3

org #A000
row1 nop
row2 nop
row3 nop

is assembled correctly so i guess the error is elsewhere

Code: [Select]
#21 #00 #98
...many zeroes...
#00 #A0 #01 #A0 #02 #A0

for a total of 4099 bytes

The simplified example I gave was just to demonstrate the code structure.

In my program where I'm moving a large sprite around the screen, the sprite is drawn very quickly, when I don't have the ORG before the jumptable.
When I do have the ORG before the jumptable, the program slows down tremendously, although I think it is the screen rendering that is being slowed down instead of the sprite.

Actually maybe the ORG #9800 is clashing with something in my rendering code... I don't think it is, but I'll check it out.
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.265
  • Country: au
    • index.php?action=treasury
  • Liked: 933
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #113 on: 15:41, 11 May 18 »
Yes, indeed it was my silly mistake.
I was overwriting other data.

My apologies for the confusion.
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline fgbrain

  • CPC6128
  • ****
  • Posts: 220
  • Country: gr
    • index.php?action=treasury
    • Chaos CPC Homepage
  • Liked: 111
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #114 on: 11:05, 14 May 18 »
RASM looks awesome... but it doesnt run in my old PC  (win xp)

it says "rasm.exe is not a valid win32 application"  >:(

sorry perhaps I am old and lame...
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #115 on: 11:53, 14 May 18 »
RASM looks awesome... but it doesnt run in my old PC  (win xp)

it says "rasm.exe is not a valid win32 application"  >:(

sorry perhaps I am old and lame...


I will try to compile a 32 bits version (if i find the correct compiler option)
use RASM, the best assembler ever made :p

I will survive

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #116 on: 14:54, 14 May 18 »
RASM looks awesome... but it doesnt run in my old PC  (win xp)
it says "rasm.exe is not a valid win32 application"  >:(


I added the archive rasm_v086_exewin32.zipin the first post
use RASM, the best assembler ever made :p

I will survive

Offline fgbrain

  • CPC6128
  • ****
  • Posts: 220
  • Country: gr
    • index.php?action=treasury
    • Chaos CPC Homepage
  • Liked: 111
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #117 on: 21:15, 14 May 18 »
I am sorry to say that this new exe doesn't work as well...

Runs in window and closes immediately!!
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #118 on: 21:19, 14 May 18 »
I am sorry to say that this new exe doesn't work as well...

Runs in window and closes immediately!!
It's a command line tool, so open a terminal to run it

And as Rasm is the fastest assembler ever made, i'm happy to see the windows closes "immediately" even on an old XP machine  ;D
use RASM, the best assembler ever made :p

I will survive

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.079
  • Country: dk
    • spinpoint.org
  • Liked: 1140
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #119 on: 23:15, 14 May 18 »
And as Rasm is the fastest assembler ever made, i'm happy to see the windows closes "immediately" even on an old XP machine  ;D
It's lightning fast indeed, big pleasure to use, thanks!

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #120 on: 16:57, 18 June 18 »
Hi

For the time being, Rasm manage local labels inside macro & loops

As indicated by his name, local means local. That kind of label cannot be exported/used outside the macros or the loops

example:
Code: [Select]
repeat 10


add hl,bc


jr c,@verflow


dec hl


@verflowrend
As suggested by Krusty, it could be cool to have another kind of local labels. I think a cool name could be 'proximity labels'

Instead of macro or loops, the scope of operation will be delimited by global labels (default labels are globals)

example:
Code: [Select]
routin1


ld b,5
@proximity


djnz @proximityret

routin2


ld b,5
@proximitydjnz @proximityret

This kind of labels may be used outside the scope, using the previous global label as prefix

Code: [Select]
ld hl,routin1.proximity


ld de,routin2.proximity

The things is local labels and proximity labels will share the '@' prefix, leading (i think) to confusion

I may use the dot '.' prefix for proximity labels, but only in pure Rasm mode (not Maxam compatible) as the dot was a f*cking sh*tty method to declare labels

So i'm not yet decided on the right syntax (but using the dot make sense)






« Last Edit: 09:19, 19 June 18 by roudoudou »
use RASM, the best assembler ever made :p

I will survive

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 867
  • Country: fr
  • Liked: 820
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #121 on: 23:52, 18 June 18 »
Can you fix the return carriages of your code snippets please? I don't understand exactly how this works! Thanks.
Targhan/Arkos

Arkos Tracker 2 - alpha 5 now released! - Follow the news on Twitter!
Disark A cross-platform Z80 disassembler/source converter

Imperial Mahjong
Orion Prime

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 630
  • Country: fr
    • urban exploration
  • Liked: 871
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #122 on: 09:18, 19 June 18 »
Can you fix the return carriages of your code snippets please? I don't understand exactly how this works! Thanks.


sorry, always this shitty WYSI(not)WYG editor  >:(
use RASM, the best assembler ever made :p

I will survive

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 134
  • Country: fr
  • Liked: 100
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #123 on: 09:45, 19 June 18 »
I think the dot notation makes more sense because:
 - other assemblers I used do that - more importantly, the semantic is not the same; so there is no reason that the symbol to use is the same
@targhan I'm pretty sure sjasmplus has local labels

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 867
  • Country: fr
  • Liked: 820
Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
« Reply #124 on: 12:59, 19 June 18 »
The dot makes sense. However... what would be the use of such "proximity" label?


@krusty_benediction yes, SJAsmplus manages local labels.
Targhan/Arkos

Arkos Tracker 2 - alpha 5 now released! - Follow the news on Twitter!
Disark A cross-platform Z80 disassembler/source converter

Imperial Mahjong
Orion Prime