IRQ Installer

Basic and Machine Language

Moderator: Moderators

groepaz
Vic 20 Scientist
Posts: 1188
Joined: Wed Aug 25, 2010 5:30 pm

Re: IRQ Installer

Post by groepaz »

I am curious... is there a practical reason for why this has to be fully relocatable? Or is it just for the challenge? :)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: IRQ Installer

Post by chysn »

Mike wrote: Sat Mar 07, 2020 6:00 pm Anyhow, here's a slightly smaller version, with the roles of X and Y reversed. Interrupts are disabled just around the critical section. The "GetPC" routine probably gets used more than once in a bigger example, so I used $03/$04 as scratch pad - with the offset added to Y:X with TXA and TYA (instead of doing STX $03, STY $04 as yet another temporary store in between):
Yeah, nice!

I was able to shave off one byte by removing

Code: Select all

.2020  8A        TXA
due to this already having been done in the FAC2 routine.
groepaz wrote: Sat Mar 07, 2020 6:28 pm I am curious... is there a practical reason for why this has to be fully relocatable? Or is it just for the challenge? :)
I'm not sure yet, really. I'm just going to have it around in case something comes up later.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: IRQ Installer

Post by Mike »

Good morning!
chysn wrote:I was able to shave off one byte [...]
Yeah, it was around 1 A.M. local time when I wrote this code. At this time of day, such things inevitably slip through.

... :wink:
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: IRQ Installer

Post by chysn »

For me, the difference between a high-level language and machine language is that, in my machine language code, I keep finding optimizations for a much longer time, pretty much whenever I seriously inspect it. I always imagine that there's this perfectly-efficient version of what I want to do that takes flawless advantage of every trick out there, and all the laws of physics and thermodynamics, that I probably wouldn't even recognize as a "program," and that's only half as long as what I wrote.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
groepaz
Vic 20 Scientist
Posts: 1188
Joined: Wed Aug 25, 2010 5:30 pm

Re: IRQ Installer

Post by groepaz »

Stared at it for a while, looking for an opportunity to shave off another byte with an illegal opcode - but it seems to be quite optimal now :)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: IRQ Installer

Post by chysn »

groepaz wrote: Sun Mar 08, 2020 9:51 am Stared at it for a while, looking for an opportunity to shave off another byte with an illegal opcode - but it seems to be quite optimal now :)
Thanks for taking a look!

I should take some time to learn the illegal opcodes. My geek buddies and I discovered some of them in middle school, but we never wrote anything down.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
groepaz
Vic 20 Scientist
Posts: 1188
Joined: Wed Aug 25, 2010 5:30 pm

Re: IRQ Installer

Post by groepaz »

<shameless self advertising>
i have spent a lot of time on researching them and proving/verifying how they work in the past years... i think by now the most complete document on the matter can be found here
</shameless self advertising>
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Post Reply