Posted By
zbyti on 2021-06-30 08:10:29
| Re: K65 assembler
@Basman it's interesting because KK/Altair once said (asked why he developed K65 - passion or obsession):
"K65 already saved me more time than it took to write, and enabled making some cool things I wouldn't dare to do with classic assembler, so they sometimes point in the same direction. "
He used K65 to develop some winner demos on Atari VCS and game (Druidarium) on A8.
--- EDIT ---
self modifying code example Neverten
//------------------------------------------------------------------------------ // Neverten by Bitglamour // // https://plus4world.powweb.com/software/Neverten // // Converted to K65 by zbyti //------------------------------------------------------------------------------
var SCREEN_COL=0x0900, SCREEN_CH=0x0D00
var CHSET=0xD180 var NORSCREEN=0xD888
var TED_15=0xFF15, TED_19=0xFF19
main { a=0x41 TED_15=a TED_19=a
//ESC-N Set normal screen, Clear screen, Cursor on Home call NORSCREEN
{ .chr: a=0x80 .chars+1=a x=0 { .chars: a=CHSET y=0 { c- a<<< a!! a=0xA0 .scrch: SCREEN_CH,y=a a=0 c+?{ a=0xFF } .scrcol: SCREEN_COL,y=a a?? y++ y?8 } != c- a=.scrch+1 a+40 .scrch+1=a .scrcol+1=a .chars+1++ a=.chars+1 a?0xD0 =={ .chars+1=a=0x80 } x++ x?7 } != a=0 .scrch+1=a .scrcol+1=a .chr+1++ a=.chr+1 a?0xD0 =={ .chr+1=a=0x80 } { { y++ } != x++ x?0x48 } != } always }
this example
--- EDIT ---
Moving At High Velocity
//------------------------------------------------------------------------------ // Moving At High Velocity by Cobini // // https://plus4world.powweb.com/software/Moving_At_High_Velocity_5000 // // Converted to K65 by zbyti //------------------------------------------------------------------------------
var tmp=0x10 var OS_CH_COLOR=0x053B var SCREEN=0x0C00 var NORSCREEN=0xD888 var TED_7=0xFF07, TED_15=0xFF15, TED_19=0xFF19, TED_1D=0xFF1D
main { OS_CH_COLOR=a=0x67
//ESC-N Set normal screen, Clear screen, Cursor on Home call NORSCREEN
TED_15=a=0x1D TED_19=a { x=0x24 { x?TED_1D } !=
{ { a=TED_1D a&7 a?3 } !=
a=x a+tmp,x tmp,x=a a>> a&7 TED_7=a
y++ a=0x7B SCREEN,y=a SCREEN+0x100,y=a SCREEN+0x200,y=a SCREEN+0x300,y=a x-- } != } == }
this example
--- EDIT ---
//------------------------------------------------------------------------------ // Mikropyros by Luca // // https://plus4world.powweb.com/software/Mikropyros // // Converted to K65 by zbyti //------------------------------------------------------------------------------
var pagelo = 0xE0 var pagehi = 0xE1 var screenlo = 0xE2 var screenhi = 0xE3 var colorlo = 0xE4 var colorhi = 0xE5 var height = 0xE6
var tmp=0x7FE7
var TED_0=0xFF00, TED_15=0xFF15, TED_19=0xFF19, TED_1E=0xFF1E, TED_3F=0xFF3F
main { align 32 //this prevent override main code by the doFlame loop
i+ TED_3F=a height=a=0xA0 TED_15=a TED_19=a
{ a=height a?2 !={ height-- } x=0x29 { a=TED_0 a^TED_1E a&0x3F tmp,x=a x-- } != pagelo=x screenlo=x colorlo=x pagehi=a=0x7C screenhi=a=0x0C colorhi=a=0x08
{ //doFlame
{ c- y=0x27 a=(pagelo),y y++ a+(pagelo),y y++ a+(pagelo),y y=0 a+(pagelo),y a-height <{ a=y } a>> a>> (pagelo),y=a a>> a>> a?8 >=0{ a=8 } x=a a=colors,x (colorlo),y=a a=chars-1,x (screenlo),y=a pagelo++ screenlo++ colorlo++ } !=
colorhi++ screenhi++ pagehi++
} >=0
} <0 }
data colors { 0 0x0E 0x14 0x2B 0x32 0x42 0x58 0x67 0x71 }
data chars { 0x2E 0xD6 0x51 0xE0 0xE0 0xE0 0xE0 0xE0 }
--- EDIT ---
//------------------------------------------------------------------------------ // C+4 palette by zbyti //------------------------------------------------------------------------------
forum engine striped out my code, look at github
this example
|