Author Topic: ASM - Can someone make this work?  (Read 6043 times)

0 Members and 1 Guest are viewing this topic.

Offline Unseen Machine

  • Forum Regular
  • Posts: 158
  • Make the game not the engine!
    • View Profile
Re: ASM - Can someone make this work?
« Reply #15 on: June 25, 2020, 06:45:55 am »
Hi Jack,

Firstly i gotta give kudos to the fact you've tried but the idea is to be able call ASM without having to rely on external wrappers. I kinda figured it wouldnt be possible as QB64 currently stands (im ok with that as it was just an experiment anyway.)

Unseen

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: ASM - Can someone make this work?
« Reply #16 on: June 25, 2020, 07:48:31 am »
@jack
great examples to use C++ with inline ASM

@Unseen Machine
great you want a direct inline ASM (do you like also a C/C++ inline without  DUMMY.h files?)!
This is an open towards the enemy of QuickBasic... TurboBasic 1.0 that had ASM inline...
like this
Code: QB64: [Select]
  1. DEFINT A-Z
  2. DIM ARRAY(200)
  3. CALL FILL(ARRAY(0))
  4. FOR I = 0 TO 199
  5. PRINT A(I)
  6.  
  7. SUB FILL INLINE
  8. $INLINE &H55 ' push BP    save the Base Pointer
  9. $INLINE &H89,&HE5 ' mov BP,SP    move stack pointer to BP
  10. $INLINE &HC4,&H7E,&H06 ' les DI,[BP+6]  offset address of parm
  11. $INLINE &HB8,&H64,&HOO ' mov AX,64H   constant to FI LL
  12. $INLINE &HB9,&HC8,&HOO ' mov CX,C8H   length of FILL
  13. $INLINE &HFC ' cld  clear the direction flag
  14. $INLINE &HF3   ' rep    fill the words
  15. $INLINE &HAB ' stosw
  16. $INLINE &H5D ' pop BP   restore Base Pointer
  17.  
  18.  
see here https://books.google.it/books?id=5z4EAAAAMBAJ&pg=RA1-PA56&lpg=RA1-PA56&dq=turbo+basic+inline+asm&source=bl&ots=ftvfEVxofT&sig=ACfU3U2aLo3a71YvHL_T_CKLQKWKke0LGg&hl=it&sa=X&ved=2ahUKEwjEkIft6pzqAhXRwosKHYIeA8cQ6AEwAXoECAwQAQ#v=onepage&q=turbo%20basic%20inline%20asm&f=false
the newspaper is of April 11 1988. :-) fine days!
Programming isn't difficult, only it's  consuming time and coffee