
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
membot wrote:Right, so, my formatting was the culprit ... i'll be tabbing around quite a bit more now
membot wrote:Right, so, my formatting was the culprit ... i'll be tabbing around quite a bit more now
Code: Select all
clr.l -(a7) ; clear stack
move.w #32,-(a7) ; prepare for super mode
trap #1 ; call gemdos
addq.l #6,a7 ; clear up stack
move.l d0,old_stack ; backup old stack pointer
move.w #$700,$ffff8240 ; red background color
move.l old_stack,-(a7) ; restore old stack pointer
move.w #32,-(a7) ; back to user mode
trap #1 ; call gemdos
addq.l #6,a7 ; clear stack
clr.l -(a7) ; clean exit
trap #1 ; call gemdos
old_stack:
dc.l 0
rocket-dog wrote:
Thank you. I have looked and looked and looked and looked and looked and looked and looked and looked and looked but to no avail.
I think I will just go with DevPac 3. You guys can carry discussing the merits of 3 vs 2 and 2 vs 3. I wouldn't understand what was being said anyway.
zonky900 wrote:Just wanted to also say thanks for these documents, I used to code 68k for old Macs really long ago but am excited to start working on the ST too
Code: Select all
section data
old_palette ds.l 8
old_resolution dc.w 0
old_stack dc.l 0
section dss
old_screen dc.l 0
Code: Select all
section data
old_screen dc.l 0
old_resolution dc.w 0
old_stack dc.l 0
section bss
old_palette ds.l 8
Kriegor wrote:Am I on track here?
Code: Select all
.data
.bss
old_palette: ds.w 16
old_resolution: ds.w 1
old_stack: ds.l 1
old_screen: ds.l 1
Code: Select all
.bss
.align 4
screen_buffer: ds.w 320*240
Code: Select all
.bss
.align 4
screen_buffer: ds.l 38400
Anima wrote:Kriegor wrote:Am I on track here?
Hello Kriegor,
yes.
You have learned the hard way why it is sometimes really awkward to use assembly code between different assemblers. However, albeit some assemblers allow to have "ds.x" within the data section it seems that "section dss" is indeed a typo.
Some additional notes:
As any of these "memory variables" will be defined at the initialisation routine all of them can be moved to the BSS. So it would look like this:Code: Select all
.data
.bss
old_palette: ds.w 16
old_resolution: ds.w 1
old_stack: ds.l 1
old_screen: ds.l 1
Advantage: the memory space used to store the values will not add up to the program size.
You may ask why I have chosen "ds.w 16" over "ds.l 8". Well, you should use the original size of the data even if it is the same result but later on it's easier to understand and easier to change the code.
Another example is declaring a two dimensional array:Code: Select all
.bss
.align 4
screen_buffer: ds.w 320*240
This example declares a true colour screen buffer for the Falcon030 which says: 320 pixels wide by 240 pixels height with a pixel size of 16 bits (one word). So if you want to change your resolution you can do it by changing the values.
It's better than having this:Code: Select all
.bss
.align 4
screen_buffer: ds.l 38400
Cheers
Sascha
He welcomes any and all feedback at <andreaswahlin@bredband.net>.
LynXX wrote:Yeah I new about this sad fact, but I was a bit reluctant to modify the original text too much... Perhaps it makes sense though, let's see what other people think?
LynXX wrote:Small update on this, the listings now have syntax highlighting. It's minor, but that make them a bit more readable.
syntax.png
It took me a while get all the pieces together, I had to start by contributing the m68k syntax to one of the syntax highlighter used by AsciiDoctor!
https://nguillaumin.github.io/perihelio ... tutorials/
Users browsing this forum: No registered users and 2 guests