Respond to this messageReturn to Index
Original Message
  • i guess you're using qbasic
    • (Login MCalkins)
      Moderator
      Posted Aug 1, 2011 6:56 PM

      Following qbguy's suggestion, I decided I would make assembly functions for both QBASIC 1.1 and QB64. I wrote one for QB64, but then I realized I could probably just do it from the C header file. Then, I decided to just try it in QB64, and found out that there is no overflow checking anyway. For that reason, I'm guessing you're using QBASIC 1.1 (or QB).

      Regards,
      Michael

      ----------------------------------------------------------------

      ;public domain
      cpu 386
      org 0x0

      push bp
      mov bp,sp
      push ds
      lds bx,[bp+0xa]
      mov eax,[bp+0x6]
      add [bx],eax
      pop ds
      pop bp
      retf 0x8

      ----------------------------------------------------------------

      'public domain
      DIM a AS LONG
      DIM b AS LONG
      DIM i AS INTEGER
      DIM t AS STRING
      DIM code AS STRING * 19

      t = "5589e51ec55e0a668b46066601071f5dca0800"
      FOR i = 0 TO 18
      MID$(code, i + 1, 1) = CHR$(VAL("&h" + MID$(t, i + i + 1, 2)))
      NEXT

      CLS
      INPUT a
      INPUT b
      DEF SEG = VARSEG(code)
      CALL absolute(SEG a, BYVAL b, VARPTR(code))
      PRINT a
      SYSTEM

      ----------------------------------------------------------------
    Your Name
    Your Email
    (Optional)
    Message Title
    Message Text
    Options Also send responses to my email address