Author Topic: BASIC (Ab)Uses of Assembly Opcodes  (Read 15125 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC (Ab)Uses of Assembly Opcodes
« Reply #30 on: January 22, 2011, 06:09:49 pm »
This is the first time I check this and it looks great! ;D

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: BASIC (Ab)Uses of Assembly Opcodes
« Reply #31 on: January 22, 2011, 07:16:53 pm »
The PDF is fine. It could be organized differently, but is definitely useable as-is.

So, a quick question: would these be separate programs, or could the opcodes be directly put into your games?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC (Ab)Uses of Assembly Opcodes
« Reply #32 on: January 22, 2011, 07:55:05 pm »
Ah, good question. They cannot be used *normally* directly in BASIC program. You need to actually create a separate program and then call it in a BASIC program using Asm(prgmPROGRAM
Here is a little demo for inputting codes:


However, if you want to experiment a little (back up or archive your proggies, first!) you can combine opcodes, but you need to drop the "C9" for it to work. So, say you want to turn off the LCD, turn off the run indicator, clear the LCD and then turn the screen back on, you can do:
Code: [Select]
3E02D310
EF7045
EF4045
3E03D310
C9

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BASIC (Ab)Uses of Assembly Opcodes
« Reply #33 on: January 23, 2011, 02:52:29 am »
I guess that's the great thing about hex programming: You can code ASM-like programs and immediately test them without having to compile anything. Granted, I recommend frequent backups because of RAM clears but if you manage to get used to it you gain the advantage of BASIC programming.

That said, when releasing your games it's best to include a version you processed with AsmComp(prgnSOURCE,prgmCOMPILED) so it's twice smaller (and in some cases twice faster to run)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)