12Me21
12Me21
85 / 3
1st Jun 2017
7th Jun 2017
reset: MOV bx,0 MOV dx,50001 MOV ex,0 loop: MOV ax,bx ADD ax,dx @noflags MOV cx,0 ADC cx,0 SHRD ax,cx,1 SEND 0,ax ADD ex,1 WAIT cx CMP cx,2 JA toohigh JB toolow SEND 0,ex HLT JMP reset toohigh: MOV dx,ax JMP loop toolow: MOV bx,ax JMP loop
r16k1s60 pressstart memorydump program 60hz 16bit quiteuseless pressenterlumage

Comments

  • LBPHacker
    LBPHacker
    3rd Jun 2017
    Hmm, fail. That's send ax, ax. I meant 0x5000.
  • LBPHacker
    LBPHacker
    3rd Jun 2017
    So yeah, my bad. But hey, there's a solution! Encode the opcode directly! "dw 0x5090"
  • LBPHacker
    LBPHacker
    3rd Jun 2017
    Well yeah, but the assembler doesn't expect you to actually try doing so.
  • 12Me21
    12Me21
    3rd Jun 2017
    I could've sworn I read something like "Any instruction is capable of encoding a single immediate value and not more than that, which means that instructions such as mov [0xCAFE], 0xBABE are not possible to encode [unless the address and value to be written are the same, which is unlikely]"
  • LBPHacker
    LBPHacker
    3rd Jun 2017
    I'd look into it but I'm totally out of context. I hate to say this but you should just try to avoid passing two immediates.
  • Qweryntino
    Qweryntino
    3rd Jun 2017
    Well, maybe it's just not designed like that
  • 12Me21
    12Me21
    3rd Jun 2017
    I know you can only pass one immediate value, but you should be able to use it multiple times in a single instruction.
  • Qweryntino
    Qweryntino
    3rd Jun 2017
    Yes, it is not possible to pass more than one immediate value, sadly. Did you read instruction reference?
  • Preset
    Preset
    3rd Jun 2017
    Dude this is incredible...
  • asthepanda3
    asthepanda3
    2nd Jun 2017
    Not all we need is negatives. :) Nice work, I can do simple games, but nothing like this. Happy to see that it can be done (I say this in almost every computer save I see) +x^2+2x+1