Assembly information

Pagina 4/5
1 | 2 | 3 | | 5

Van Thom

Paladin (691)

afbeelding van Thom

26-11-2004, 18:47

Or: EQU is the equivalent of #DEFINE in C. (well... a bit)

Van Manuel

Ascended (18783)

afbeelding van Manuel

26-11-2004, 19:04

By the way,

Can I use C and Assembly in MSX together?

You can but beleive me you don't want to Smile

And why not? I've been doing it with AuroraMSX and it's not a problem...

Van LeandroCorreia

Paladin (955)

afbeelding van LeandroCorreia

26-11-2004, 19:48

Well, keeping on Assembly...

I created a ROM that enters in Screen 1. Now I want to display letter "A" at the top-left screen position, and then stop the program (freeze the computer) so I can admire my great work. How should I do it? I suppose that I must set the correct memory address with the byte 65 (letter A). Is that correct? Tongue

Van LeandroCorreia

Paladin (955)

afbeelding van LeandroCorreia

26-11-2004, 20:53

Oh, yes. The HALT instruction freezes the computer, right?

Van Sonic_aka_T

Enlighted (4130)

afbeelding van Sonic_aka_T

26-11-2004, 21:02

No, HALT just waits for the next interrupt. If you DI and then HALT you would indeed lock up the computer.

Van Sonic_aka_T

Enlighted (4130)

afbeelding van Sonic_aka_T

26-11-2004, 21:07

Well, at the beginning you may want to use BIOS routines a lot. So to print an "A" I guess you could either use the CHPUT routine at $00A2 (assuming that works in SCREEN1, dunno) or use WRVRM at whatever address it could be on in the MSX1 BIOS. There's also routines to send a whole bunch of data to VRAM, but I'm really not very familiar with the MSX1 routines.

Perhaps it's a good idea to first learn on MSX2? It's a lot easier to do, and probably more phun too, since you will get nices results in an early stage. Once you've got the basics down you can always return to MSX1...

Van LeandroCorreia

Paladin (955)

afbeelding van LeandroCorreia

26-11-2004, 21:18

To Sonic...

I can´t learn ón an MSX2. I never had one. Sad

Van Sonic_aka_T

Enlighted (4130)

afbeelding van Sonic_aka_T

26-11-2004, 21:21

Uhm, you ever heard of emulation buddy? Wink Tongue Having openMSX is like having an MSX2. Maybe you can buy one on ebay, just to have the real thing too. No MSX freak can be a true MSX freak without owning an MSX2. Heck, even I have and MSX1 and an MSX2 lying around somewhere for nostalgia's sake! Tongue

Van wolf_

Ambassador_ (9956)

afbeelding van wolf_

26-11-2004, 21:30

leandro, no msx-freak can be complete without sd-snatcher running on real hardware Smile

Van MOA

Champion (293)

afbeelding van MOA

26-11-2004, 22:26

Now it works...

.bios 
.page 1 
.rom
.start MY_PROGRAM 

MY_PROGRAM:
Init32 equ 7bh
call Init32

Shouldn't your program end with a 'RET' (return)? Always see your own program as a sub-routine for the system.

Note:

CALL <address> + RET can be replaced by JP <address>. This saves a few cycles, 2 bytes of stack space and 1 byte of RAM/ROM space.

(although you shouldn't really care about that since this code is executed only once and you won't run into any memory problems anyway with programs this size Wink )

Pagina 4/5
1 | 2 | 3 | | 5