Unfortunately, this site has restricted functionality as this browser does not support the HTML button formaction attribute.
Unfortunately, this site has restricted functionality as this browser has HTML web storage turned off.

memoCPU ver: 0.003. by Kindergarten

1 of 2 files kindergarten
3 items
  • MEMOCPU.ASM
  • MEMOCPU.COM
  • MEMOCPU.PRJ
  • Zip / DOS   Computer tool
  • 4 kB   DOWNLOAD   SHARE

Emulating MEMOCPU.COM in DOSee.

Use these tabs to make adjustments to the emulation

If the emulation is taking too long to load, you can turn it off.

Applying changes will reload the page and reboot the emulator





Changes will not be applied until this browser tab has been refreshed





DOS programs need a keyboard for user input

ENTER to select or continue
ESC to navigate back or exit
are often used to navigate menus


Emulation too fast?
Set the emulator to use the 386 CPU configuration
Experiencing graphic or animation glitches?
Set the emulator to use VGA only graphics configuration
Need to turn off the audio?
Disable sound card support

Have no audio?
  1. Try Gravis Ultrasound hardware
  2. The song or audio file maybe missing from the program

Want to hack around in the DOS prompt?
  1. Mount the DOS tools drive with automatic run program turned off
  2. Then dir u: to list the utilities, some included programs 4dos.com cp.exe acidview.exe pictview.exe
  3. Use mount to list the emulated drives
  4. Learn the DOSBox commands

DOSee pronounced dos/see, is our emulator used to run MS-DOS based software in your web browser.

MS-DOS (Microsoft DOS) was the primary operating system used by PCs during the 1980s to the early 1990s and is the precursor to Microsoft Windows.


DOSee is a slimmed down, modified port of The Emularity.

The Emularity is a multi-platform JavaScript emulator that supports the running of software for legacy computer platforms in a web browser. It is the same platform that's running emulation on the Internet Archive.

EM-DOSBox is a high-performance JavaScript port of DOSBox that is applied by The Emularity for its emulation of the MS-DOS platform.

DOSee uses BrowserFS ZipFS and ZipFS Extras to simulate zip file archives as hard disks within EM-DOSBox.

DOSBox is the most popular MS-DOS emulator in use today and is frequently used by commercial game publishers to run games from their back-catalogues on modern computers.


DOSee, built on The Emularity, EM-DOSBox and DOSBox. Capture screenshot and save function built on canvas-toBlob.js.

[+] Configuration Select all
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; project name: memoCPU
; coder: anormal/kindergarten
; notes: just another CPU emulator designed with protection in mind
;
; ver: 0.001 : Mon 04-06-1998 : initial
; ver: 0.002 : Tue 04-07-1998 : +opcodes & macros
; ver: 0.003 : Wed 04-08-1998 : +emulated code
;                               +start debugging, tons (really) of fixes :)
;                               +and finished :)
;                               *1st working version
; time: 0.001 : 1:15
; time: 0.002 : 0:50
; time: 0.003 : 2:10
;
;
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
code segment
org 100h
assume cs:code,ds:code

; opcode macros
_xor macro orig1,orig2,next_ip
    db   0,orig1,orig2,next_ip
endm

_add macro orig1,orig2,next_ip
    db   2,orig1,orig2,next_ip
endm

_inp macro dest,cnt,next_ip
    db   4,dest,cnt,next_ip
endm

_out macro orig1,next_ip
    db   6,orig1,0,next_ip
endm

_mov macro orig1,dest,next_ip
    db 8,orig1,dest,next_ip
endm

_stp macro
    dd 0000000ah
endm

_jnz macro orig1,ip1,ip2
    db 0ch,orig1,ip1,ip2
endm
;--------------------------------------------------------------------------
start:
.386
    sub  eax,eax
    sub  cx,cx
    sub  dx,dx
    mov  si,offset memory
    mov  di,si
    sub  bx,bx

nextCycle:
      mov  eax,[si]         ;get opcode from next_ip
      mov  bl,al
      call [bx+offset opcodeTable]
      shr  eax,8            ;the next_ip is in the 1st byte of eax
      mov  si,ax            ;si=next_ip
      add  si,di            ;+initial offset
    jmp  nextCycle

;emulation procedures ----------------------------------------------------
;0  xor  orig1  ,dorig2  ,next_ip    ;[email protected] xor @orig1
opXor:
    mov  bl,ah       ;get orig1
    mov  cl,[bx+di]  ;get value of orig1
    shr  eax,16
    mov  bl,al       ;get orig2
xorit:
    xor  [bx+di],cl  ;xor it
ret

;2  add  orig1  ,dorig2  ,next_ip    ;[email protected]  +  @orig1
opAdd:
    ;let's do it automodifying the code of opXor
    mov  byte ptr [xorit],bh         ;bh is always 0, 0 is the opcode for add :)
    call opXor
    mov  byte ptr [xorit],30h        ;restore the value of the xor opcode = 30
ret
;4  inp  dest,cnt,next_ip    ;dest=cnt bytes @keyboard
opInp:
    mov  cl,ah                ;get dest
    shr  eax,16
    mov  bl,al
    push bx                   ;saves ptr to maxcnt
    mov  al,[bx+di]           ;get max counter
    mov  maxcnt,al
    mov  dx,offset maxcnt
    push ax
    mov  ah,0ah
    int  21h
    pop  ax
    mov  bl,cl              ;restore dest
    mov  cl,cnt
    mov  si,offset buffer
copy:
    mov  al,[si]
    mov  [bx+di],al
    inc  si
    inc  bx
    dec  cl
    jnz  copy
    pop  bx
    mov  cl,cnt
    mov  [bx+di],cl        ;updates maxcnt
    ret
ret

;6  out  orig   ,nil     ,next_ip    ;[email protected]
opOut:
    mov bl,ah
    mov dl,[bx+di]
    mov ah,02
    int 21h
    shr  eax,16
ret
;8  mov  orig ,dest ,next_ip  ;[email protected][orig] - double indirection
opMov:
    mov  bl,ah       ;get orig1
    mov  bl,[bx+di]  ;get pointer to value of orig1
    mov  cl,[bx+di]  ;get value of orig1
    shr  eax,16
    mov  bl,al       ;get orig2
    mov  [bx+di],cl  ;xor it
ret

;a  stp  nil    ,nil     ,nil        ;stop cpu
opStp:
    pop  ax                  ;pop the return address to the main loop
ret

;c  jnz  orig1  ,next_ip1,next_ip2 ;if @orig1<>0 jmp to ip1 else to ip2
opJnz:
    mov  bl,ah
    shr  eax,16
    cmp  [bx+di],bh    ;remember bh is always 0
    je   not0
    mov  ah,al         ;change the nextip
not0:
ret

opcodeTable dw offset opXor,offset opAdd,offset opInp,offset opOut
            dw offset opMov,offset opStp,offset opJnz

;begin of emulated code --------------------------------------------------

memory:
buc1:
   _mov 141,142,4    ;getchar from string
   _xor 143,142,8    ;xorit with key
   _add 145,143,12   ;inc key1
   _out 142    ,16   ;print
   _add 144,140,20   ;dec length
   _add 145,141,24   ;inc ptr
   _jnz 140,0,28     ;if length<>0 repeat

   _inp 162,146,32   ;get 8max bytes pass
   _mov 158,157,36   ;saves maxcnt
buc2:
   _mov 148,142,40   ;getchar from pass
   _xor 142,149,44   ;xor var2 with var1
   _add 144,146,48   ;dec length pass
   _add 145,148,52   ;inc ptr
   _jnz 146, 36,56   ;if length<>0 repeat

   _add 144,148,60   ;dec ptr
   _add 144,157,64   ;dec maxcnt2
   _mov 148,142,68   ;get last char from pass
   _add 142,149,72   ;var2+=last char from pass
   _jnz 157, 56,76

   _add 150,149,80   ;add -result to var2
   _jnz 149, 96,84
yes:
   _mov 160,151,88   ;ptr to st2=ptr to st3
   _mov 159,154,92   ;key3=key2
   _mov 161,152,96   ;length bad=length ok
no:
   _mov 151,142,100  ;getchar
   _xor 154,142,104  ;xorit with key
   _add 145,154,108  ;inc key3
   _out 142    ,112  ;print
   _add 144,152,116  ;dec length
   _add 145,151,120  ;inc ptr
   _jnz 152,96 ,124  ;if length<>0 repeat
   _stp

filler db 140-(offset filler - offset memory) dup (0)

; begins at 140 decimal
dat db lst1                                   ;140=length of st1
    db (offset st1-offset dat)+140            ;141=ptr to st1
    db 00                                     ;142=var1
    db 'r'                                    ;143=key1
    db 0ffh                                   ;144=-1
    db 1                                      ;145=1
mxc db 8                                      ;146=8
    db 143                                    ;147=143
    db 162                                    ;148=ptr to pass
    db 0                                      ;149=0             ;var2
    db -0f0h                                  ;150=-result
    db (offset st2-offset dat)+140            ;151=ptr to st2
    db lst2                                   ;152=length of st2
    db 'u'                                    ;153=key2
    db 'v'                                    ;154=key3
    db lst3                                   ;155=length of st3
    db (offset st3-offset dat)+140            ;156=ptr to st3
    db 00                                     ;157=maxcnt2
    db (offset mxc-offset dat)+140            ;158=ptr to maxcnt
    db 153                                    ;159=ptr to key2
    db 156                                    ;160=ptr to ptr to st2
    db 155                                    ;161=ptr to length st3
pas db 19,87,83,71,15,23,84,27,89,58          ;162=pass (initializated with garbage)
    db 'apocalypse'                           ;    rest of pass, hehehe
st1 db 0ah xor 'r'                            ;st1 xor key1
    db 0dh xor ('r'+01)
    db 'm' xor ('r'+02)
    db 'e' xor ('r'+03)
    db 'm' xor ('r'+04)
    db 'o' xor ('r'+05)
    db 'C' xor ('r'+06)
    db 'P' xor ('r'+07)
    db 'U' xor ('r'+08)
    db ' ' xor ('r'+09)
    db 'b' xor ('r'+10)
    db 'y' xor ('r'+11)
    db ' ' xor ('r'+12)
    db 'a' xor ('r'+13)
    db 'n' xor ('r'+14)
    db 'o' xor ('r'+15)
    db 'r' xor ('r'+16)
    db 'm' xor ('r'+17)
    db 'a' xor ('r'+18)
    db 'l' xor ('r'+19)
    db '/' xor ('r'+20)
    db 'k' xor ('r'+21)
    db 'i' xor ('r'+22)
    db 'n' xor ('r'+23)
    db 'd' xor ('r'+24)
    db 'e' xor ('r'+25)
    db 'r' xor ('r'+26)
    db 'g' xor ('r'+27)
    db 'a' xor ('r'+28)
    db 'r' xor ('r'+29)
    db 't' xor ('r'+30)
    db 'e' xor ('r'+31)
    db 'n' xor ('r'+32)
    db 0ah xor ('r'+33)
    db 0dh xor ('r'+34)
    db 'E' xor ('r'+35)
    db 'n' xor ('r'+36)
    db 't' xor ('r'+37)
    db 'e' xor ('r'+38)
    db 'r' xor ('r'+39)
    db ' ' xor ('r'+40)
    db 'p' xor ('r'+41)
    db 'a' xor ('r'+42)
    db 's' xor ('r'+43)
    db 's' xor ('r'+44)
    db 'w' xor ('r'+45)
    db 'o' xor ('r'+46)
    db 'r' xor ('r'+47)
    db 'd' xor ('r'+48)
    db ':' xor ('r'+49)
    db ' ' xor ('r'+50)
    lst1 = $-offset st1
st2 db 0ah xor 'v'                            ;1xx=st2 xor key3
    db 0dh xor ('v'+01)
    db 'B' xor ('v'+02)
    db 'a' xor ('v'+03)
    db 'd' xor ('v'+04)
    db '!' xor ('v'+05)
    db '!' xor ('v'+06)
    lst2 = $-offset st2
st3 db 0ah xor ('u')                            ;1xx=st2  xor key2
    db 0dh xor ('u'+01)
    db 'G' xor ('u'+02)
    db 'o' xor ('u'+03)
    db 'o' xor ('u'+04)
    db 'd' xor ('u'+05)
    db '!' xor ('u'+06)
    db '!' xor ('u'+07)
    lst3 = $-offset st3
;end of emulated code ----------------------------------------------------

maxcnt db 12                    ;more trash
cnt    db 82                    ;more trash
buffer db 'heavensfacility'     ;more trash, hehehe, nice for lamers

code ends
end start
MEMOCPU.ASM 84x300 Font
84