News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_roudoudou

Rasm Z80 assembler

Started by roudoudou, 08:58, 22 February 17

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Targhan

Interesting. But for my use case, I think the shift (>>) will be more explicit, in fact!
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

roudoudou

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


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
My pronouns are RASM and ACE

Golem13

Ok ok :P ... That's a fact: I am in love :-* :-*

roudoudou

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:
My pronouns are RASM and ACE

roudoudou

#104
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
My pronouns are RASM and ACE

ervin

#105
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:

ld a,#33
ld (hl),a
inc l


Is there a way to do something like this?

ld a,#33; ld (hl),a; inc l


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


ld a,#33:ld (hl),a:inc l


Now THAT is a great feature!

roudoudou

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...)

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\.]\+"
My pronouns are RASM and ACE

Arnaud

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

roudoudou

Quote from: Arnaud on 08: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

I guess i have to find the .rel format description?
My pronouns are RASM and ACE

Arnaud

Quote from: roudoudou on 08:09, 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)

ervin

Quick question about using ORG...

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

A trivial example:


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.

roudoudou

Quote from: ervin on 01: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:


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?

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

#21 #00 #98
...many zeroes...
#00 #A0 #01 #A0 #02 #A0


for a total of 4099 bytes

My pronouns are RASM and ACE

ervin

Quote from: roudoudou on 07:57, 11 May 18
Could you be more specific?

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

#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.

ervin

Yes, indeed it was my silly mistake.
I was overwriting other data.

My apologies for the confusion.

fgbrain

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.

roudoudou

Quote from: fgbrain on 09: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...


I will try to compile a 32 bits version (if i find the correct compiler option)
My pronouns are RASM and ACE

roudoudou

Quote from: fgbrain on 09: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"  >:(


I added the archive rasm_v086_exewin32.zipin the first post
My pronouns are RASM and ACE

fgbrain

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.

roudoudou

Quote from: fgbrain on 19:15, 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
My pronouns are RASM and ACE

Duke

Quote from: roudoudou on 19:19, 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!

roudoudou

#120
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:

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: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

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)






My pronouns are RASM and ACE

Targhan

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.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

roudoudou

Quote from: Targhan on 21:52, 18 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  >:(
My pronouns are RASM and ACE

krusty_benediction

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

Targhan

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.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Powered by SMFPacks Menu Editor Mod