Git Product home page Git Product logo

sim8085's Introduction

Sim8085

โš ๏ธ Major refactor in progress. All issues and bugs will be handled with the refactoring.


Sim8085 is a online development environment for Intel 8085 microprocessor. It is hosted at https://www.sim8085.com.

Features

  1. Editor with syntax highlighting.
  2. Viewing and editing of registers, flags and memory.
  3. Debugging code with breakpoints.
  4. Opcode listing view.

Screenshot

Development

Steps

  1. Download and install emscripten prerequisites using the instructions here.
  2. Do yarn install.
  3. Do yarn start to start the development server.

Building Assembler and Simulator changes

  1. Do yarn build-assembler to build the assembler code.
  2. Do yarn build-emulator to build the simulator.
  3. Commit the changed files.

Production Build

  1. Build assembler and simulator code.
  2. Do yarn build to build the UI.
  3. Built code should be available in dist.

sim8085's People

Contributors

debjitbis08 avatar magdalini-anastasiadou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sim8085's Issues

Carry flag not set with POP PSW

Consider the following code:

jmp main

main: nop
      mvi d, 0     ; use d for sum
      lxi b, data  ; data pointer location
      jmp loop
    
loop: ldax b       ; load byte at bc
      push psw     ; save registers before cpi clears them
      cpi 0        ; compare to 0 to break loop
      jz done
      pop psw      ; restore registers
      adc d
      mov d, a
      inr c        ; increase index for data bytes
      jmp loop
done: pop psw
      hlt

data: db 7Ah, 1Ch, 5Bh, 27h, D8h, 0h

There are two errors in the execution of this code.

First of all, lxi b, data does not work. Hardcoding the location to the data is a workaround.

Second of all, pop psw does not successfully set the carry flag when it should, causing the final result of d to be F0h when it should be F1h. The 1 is added due to the carry flag on the 4th loop.

Hope you can eventually improve sim8085, otherwise gnusim8085 is the only reliable alternative.

Wrong source code for DAA

I checked your code for DAA, and I found that your are adding 6 to nibbles separately and updating flags in between.It should be not like that.
It should be:-

      LSD = last 4 bit of A, MSD = first 4 bit of A

	if ((LSD > 9 || Register::Flag::AC) && (MSD > 9 || Register::Flag::CY))
	{
		A += 0x66;
                Set carry flag;
                Set aux carry flag;
	}
	else if (LSD > 9 || Register::Flag::AC)
	{
		A += 0x06;
                Set aux carry flag;
	}
	else if (MSD > 9 || Register::Flag::CY)
	{
		A += 0x60;
		 Set carry flag;
	}
	Update SF,ZF, PF; (Based on the content of accumulator)

Decimal notation not supported?

I tried putting 'D' at the end of an operand and it gives me

Expected comment, end of input, line end, or whitespace but "D" found.

Nothing big really, removing the 'D' or leaving any notation indicates to the assembler that it is a decimal value right?

daa not working properly

1.)The daa statement is not working as per intended functionality.
MVI A, 38H
MVI B, 41H
ADD B
daa
hlt
is supposed to provide 79h in accumulator, but it does not, it adds 6 to it, even though digits are less than 10.

2.) The assembled code (conversion to opcodes), always shows wrong address, instead of showing 08xx (where program stored) it shows 00xx.
But it works anyway

Infinit loop not working

Infinite loop program is not working like "real-time-clock" project is not working, also "Hour_sec" this type of code not working
bug

SBB command error

Initially, CY = 0. Upon running the following code,

	MVI A,01H
	MVI B,FFH
	SBB B
	STA 0020H
	HLT

the output is 02H in 0020H, which is correct.

Now, initially, when CY = 0, upon running this code,

	MVI A,01H
	MVI B,FFH
        STC
	SBB B
	STA 0020H
	HLT

the output is 03H in 0020H. But, the correct answer is 01H.

After studying the codebase of this project, I could relate this bug to these lines below :
In the 2nd case, STC puts CY = 1. Therefore,

if (state->cc.cy)

is true,
and hence,
rhs--;

Here, as value of B is rhs, I think rhs++ or lhs-- will give the correct results.

Program terminated with errors!

When I executed the instruction
LXI SP,0001
It gave me an error:
Program terminated with errors!

This is most probably due to some unimplemented intruction in the simulator itself. Currently, the instructions RIM, RST, IN, DI are not supported. Please look at the JavaScript console to know more details.

sim8085 jz not working

jz instruction is neither highlighted nor able to be used.
used jnz and jmp instead, but please fix this bug.

;

jmp start

;data

;code
start: nop
lda 0100h
mov b,a
lxi h,0101h
loop: mov a,m
inr a
inr a
inx h
mov m,a
dcr b
jz end
jmp loop

end: hlt

STAX D command not working

I wrote this following program to convert a hex digit to its ASCII value(in hex) stored at 0080H.

	lxi h,0080h
        lxi d,0090h
        mov a,m
        mvi b,00h
r1:     cpi 10h
        jnc c1
        cpi 0Ah
        jc c2
        adi 37h
r2:	stax d
	inx d
        hlt
c1:	inr b
	sui 10h
        jnz r1
c2:	adi 30h
	jmp r2

Just before STAX D is called, DE register pair has 0090H. But on executing STAX D, the content of A isn't getting stored in 0090H.

Not able to edit memory view in Mobile

Please help as online teaching is now new norm these days and all the students do not have laptop/PC.

I can edit memory cell content in memory view in PC browser (chrome) by double clicking the cell, but not in Mobile chrome browser even when enabling desktop mode. I also tried disabling light mode (data saver off) in mobile.

No really an Issue but a Feature request. I loved the software btw

I mainly use the program with the keyboard shortcuts because that what your are supposed to do, So it would be great to create a some shortcuts for things like compiling the code and then running it step by step , And if their are shortcuts do you mind adding them when the website is loaded for the first time

Required for first release

Need to complete the below before the first release.

  • Accumulator editing
  • Breakpoint support
  • Reset for registers, flags and memory separately.
  • Cleaner assembler output
  • Help video
  • Automated deploy after release

SHLD issue when storing at locations 0x000B, 0x00B0 and 0x0B00 memory locations

`
;

jmp start

;data

;code
start: nop

LXI H,1001H;

SHLD 000BH;

hlt

`

On compiling the following code, it throws the error, "Expected comment, end of input, line end, or whitespace but "0" found."
There's no issue when the memory location value 0x000B is changed with any other location like 0x000C or 0x000D.

image

compilation issue when storing at 0x000B

image

The code runs perfectly when the location changes to 0x000C

There's no issue in compiling when the SHLD 000BH is changed to SHLD 000B, but then, on executing the code, the location 0x0B00 is not updated with the value of the LH register pair.

image

Provide Faster Toggling to Edit Memory Locations

If I am not wrong, there is a need to double-click (Triple Click Actually) every Memory Location to edit it. But for those who like Hand Assembly or who have large inputs to give might find it Troublesome. So there should be a Key (like TAB) to edit the next (or prev) memory location right away.

INR M not working

Let, 0090H <- F0H

After running the following program :

	LXI H,0090H
        INR M
        MOV A,M
        STA 0030H
        HLT

0030H <- F0H

But the correct answer should be 0030H <- F1H

containerize the application using docker

i am using an m2 macbook air. when trying to build the project, the process throws a bunch of errors, some complaining about the architecture among a bunch of others. it would be of help if you could containerize the application and make it available through docker. this would make it a lot easier to run on different architectures without having to delve beware of dependencies and architectures.

here's what yarn build says:

 yarn build
yarn run v1.22.19
warning ../../../../package.json: No license field
$ rimraf dist && webpack
WEBPACK GO!
Building for prod...
Hash: ab43d947a918f40cbba9
Version: webpack 3.10.0
Time: 1957ms
                            Asset       Size  Chunks                    Chunk Names
          ab43d947a918f40cbba9.js     317 kB       0  [emitted]  [big]  main
                       index.html    11.5 kB          [emitted]
                      favicon.ico    1.91 kB          [emitted]
           static/img/compile.png  645 bytes          [emitted]
         static/img/logo-dark.png  293 bytes          [emitted]
              static/img/logo.png  261 bytes          [emitted]
               static/img/elm.jpg    70.9 kB          [emitted]
static/img/[email protected]    59.9 kB          [emitted]
   [0] ./src/static/index.js 10.1 kB {0} [built]
   [1] ./src/static/styles/main.scss 6.59 kB {0} [built] [failed] [1 error]
   [4] ./src/core/8085-assembler.js 202 kB {0} [built]
   [5] ./src/core/8085.js 102 kB {0} [built]
   [8] (webpack)/buildin/global.js 509 bytes {0} [built]
  [14] ./src/static/cpuState.js 2.71 kB {0} [built]
  [15] ./src/static/tour.js 5.49 kB {0} [built]
  [16] ./src/static/8085-mode.js 2 kB {0} [built]
  [17] ./src/elm/Main.elm 1.71 kB {0} [built] [failed] [1 error]
    + 9 hidden modules

ERROR in ./src/elm/Main.elm
Module build failed: Error: Compiler process exited with error Compilation failed
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/esskayesss/.local/share/applications/sim8085/node_modules/elm/Elm-Platform/0.18.0/.cabal-sandbox/bin/elm-make ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/esskayesss/.local/share/applications/sim8085/node_modules/elm/Elm-Platform/0.18.0/.cabal-sandbox/bin/elm-make',
  path: '/Users/esskayesss/.local/share/applications/sim8085/node_modules/elm/Elm-Platform/0.18.0/.cabal-sandbox/bin/elm-make',
  spawnargs: [
    '/Users/esskayesss/.local/share/applications/sim8085/src/elm/Main.elm',
    '--yes',
    '--output',
    '/var/folders/g0/s9ccbxq91g359ljfcbs4sqsm0000gn/T/123121-8890-128qjxn.aj0d.js'
  ]
}

Node.js v19.4.0

    at ChildProcess.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-elm-compiler/index.js:141:27)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1098:16)
    at Socket.<anonymous> (node:internal/child_process:456:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:317:12)
 @ ./src/static/index.js 21:10-34

ERROR in ./src/static/styles/main.scss
Module build failed: ModuleBuildError: Module build failed: Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (111)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v5.0.0
    at module.exports (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-sass/lib/binding.js:13:13)
    at Object.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-sass/lib/index.js:13:35)
    at Module._compile (node:internal/modules/cjs/loader:1239:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
    at Module.load (node:internal/modules/cjs/loader:1096:32)
    at Module._load (node:internal/modules/cjs/loader:935:12)
    at Module.require (node:internal/modules/cjs/loader:1120:19)
    at require (node:internal/modules/helpers:112:18)
    at Object.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/sass-loader/lib/loader.js:3:14)
    at Module._compile (node:internal/modules/cjs/loader:1239:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
    at Module.load (node:internal/modules/cjs/loader:1096:32)
    at Module._load (node:internal/modules/cjs/loader:935:12)
    at Module.require (node:internal/modules/cjs/loader:1120:19)
    at require (node:internal/modules/helpers:112:18)
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:182:3)
    at NormalModule.build (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:275:15)
    at Compilation.buildModule (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:151:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:456:10
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:195:19
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:170:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:27:11)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:182:3)
    at NormalModule.build (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:275:15)
    at Compilation.buildModule (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:151:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:456:10
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModuleFactory.js:241:5
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModuleFactory.js:94:13
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/tapable/lib/Tapable.js:268:11
    at NormalModuleFactory.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/CompatibilityPlugin.js:52:5)
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/esskayesss/.local/share/applications/sim8085/node_modules/tapable/lib/Tapable.js:272:13)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModuleFactory.js:69:10
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModuleFactory.js:194:7
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
 @ ./src/static/index.js 2:0-31

ERROR in ./src/static/styles/main.scss
Module build failed: ModuleBuildError: Module build failed: Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (111)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v5.0.0
    at module.exports (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-sass/lib/binding.js:13:13)
    at Object.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-sass/lib/index.js:13:35)
    at Module._compile (node:internal/modules/cjs/loader:1239:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
    at Module.load (node:internal/modules/cjs/loader:1096:32)
    at Module._load (node:internal/modules/cjs/loader:935:12)
    at Module.require (node:internal/modules/cjs/loader:1120:19)
    at require (node:internal/modules/helpers:112:18)
    at Object.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/sass-loader/lib/loader.js:3:14)
    at Module._compile (node:internal/modules/cjs/loader:1239:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
    at Module.load (node:internal/modules/cjs/loader:1096:32)
    at Module._load (node:internal/modules/cjs/loader:935:12)
    at Module.require (node:internal/modules/cjs/loader:1120:19)
    at require (node:internal/modules/helpers:112:18)
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:182:3)
    at NormalModule.build (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:275:15)
    at Compilation.buildModule (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:151:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:456:10
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:195:19
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:170:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:27:11)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:182:3)
    at NormalModule.build (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:275:15)
    at Compilation.buildModule (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:151:10)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:456:10
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModuleFactory.js:241:5
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModuleFactory.js:94:13
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/tapable/lib/Tapable.js:268:11
    at NormalModuleFactory.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/CompatibilityPlugin.js:52:5)
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/esskayesss/.local/share/applications/sim8085/node_modules/tapable/lib/Tapable.js:272:13)
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModuleFactory.js:69:10
    at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModuleFactory.js:194:7
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
 @ ./src/static/styles/main.scss
 @ ./src/static/index.js
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js!node_modules/postcss-loader/index.js!node_modules/sass-loader/lib/loader.js!src/static/styles/main.scss:
       [0] ./node_modules/css-loader!./node_modules/postcss-loader!./node_modules/sass-loader/lib/loader.js!./src/static/styles/main.scss 3.36 kB {0} [built] [failed] [1 error]

    ERROR in ./node_modules/css-loader!./node_modules/postcss-loader!./node_modules/sass-loader/lib/loader.js!./src/static/styles/main.scss
    Module build failed: Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (111)
    For more information on which environments are supported please see:
    https://github.com/sass/node-sass/releases/tag/v5.0.0
        at module.exports (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-sass/lib/binding.js:13:13)
        at Object.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-sass/lib/index.js:13:35)
        at Module._compile (node:internal/modules/cjs/loader:1239:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
        at Module.load (node:internal/modules/cjs/loader:1096:32)
        at Module._load (node:internal/modules/cjs/loader:935:12)
        at Module.require (node:internal/modules/cjs/loader:1120:19)
        at require (node:internal/modules/helpers:112:18)
        at Object.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/sass-loader/lib/loader.js:3:14)
        at Module._compile (node:internal/modules/cjs/loader:1239:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
        at Module.load (node:internal/modules/cjs/loader:1096:32)
        at Module._load (node:internal/modules/cjs/loader:935:12)
        at Module.require (node:internal/modules/cjs/loader:1120:19)
        at require (node:internal/modules/helpers:112:18)
        at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:13:17)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
        at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
        at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
        at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
        at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
        at runLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
        at NormalModule.doBuild (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:182:3)
        at NormalModule.build (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:275:15)
        at Compilation.buildModule (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:151:10)
        at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:456:10
Child html-webpack-plugin for "index.html":
     1 asset
       [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/static/index.html 12.1 kB {0} [built]
       [2] (webpack)/buildin/global.js 509 bytes {0} [built]
       [3] (webpack)/buildin/module.js 517 bytes {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js!node_modules/postcss-loader/index.js!node_modules/sass-loader/lib/loader.js!src/static/styles/main.scss:
       [0] ./node_modules/css-loader!./node_modules/postcss-loader!./node_modules/sass-loader/lib/loader.js!./src/static/styles/main.scss 3.36 kB {0} [built] [failed] [1 error]

    ERROR in ./node_modules/css-loader!./node_modules/postcss-loader!./node_modules/sass-loader/lib/loader.js!./src/static/styles/main.scss
    Module build failed: Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (111)
    For more information on which environments are supported please see:
    https://github.com/sass/node-sass/releases/tag/v5.0.0
        at module.exports (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-sass/lib/binding.js:13:13)
        at Object.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/node-sass/lib/index.js:13:35)
        at Module._compile (node:internal/modules/cjs/loader:1239:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
        at Module.load (node:internal/modules/cjs/loader:1096:32)
        at Module._load (node:internal/modules/cjs/loader:935:12)
        at Module.require (node:internal/modules/cjs/loader:1120:19)
        at require (node:internal/modules/helpers:112:18)
        at Object.<anonymous> (/Users/esskayesss/.local/share/applications/sim8085/node_modules/sass-loader/lib/loader.js:3:14)
        at Module._compile (node:internal/modules/cjs/loader:1239:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
        at Module.load (node:internal/modules/cjs/loader:1096:32)
        at Module._load (node:internal/modules/cjs/loader:935:12)
        at Module.require (node:internal/modules/cjs/loader:1120:19)
        at require (node:internal/modules/helpers:112:18)
        at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:13:17)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
        at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
        at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
        at /Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:173:18
        at loadLoader (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/loadLoader.js:36:3)
        at iteratePitchingLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
        at runLoaders (/Users/esskayesss/.local/share/applications/sim8085/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
        at NormalModule.doBuild (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:182:3)
        at NormalModule.build (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/NormalModule.js:275:15)
        at Compilation.buildModule (/Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:151:10)
        at /Users/esskayesss/.local/share/applications/sim8085/node_modules/webpack/lib/Compilation.js:456:10
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Auxillary Carry

Auxillary Carry not working properly when INR, DCR, ADI is used

FEATURE REQUEST (Incorporate undocumented commands)

Would it be possible to incorporate three of the ten undocumented commands (DSUB, ARHL, and RDEL)? I am going through some old code and was looking for an emulator/simulator that could handle it. TIA

EB XCHG
18 RDEL
EB XCHG
AF XRA A
08 DSUB
D2 JNC XXXX

Add Comments by Ctrl + /

First of all, great work. Really helpful for 8085 beginners.
I think we should support commenting a block of lines by pressing Ctrl + / like other standard editors

No way to change where the program is stored

I am sorry but this is a very small ask.
Can u pls add a way to change where the program is stored. Currently it is stored on 0x0800 but I wanted to change it and found to way to be able to.

Wrong state of Auxiliary carry flag.

LDA 2050h MOV D, A MVI B, 0Ah LXI H, 3050h MVI C, 00h LOOP: MOV A, D ADD C MOV M, A INX H MOV C, A DCR B JNZ LOOP HLT
Auxiliary Carry should be reset after executing the following code.

`AC` flag not set with `SBB`

On executing the following code, I think both AC and CY flags should set;
however, only the CY flag sets in the simulator.

mvi a, 1fh
mvi b, ffh
sbb b

CMP instruction does not trigger Carry flag

A simple program to arrange numbers in descending order:

	   MVI C,04

RELOOP:	   MVI B,04
	   LXI H,2201H

LOOP: 	   MOV A,M
	   INX H
	   CMP M
	   JNC NOSWAP
	   JZ NOSWAP
	   MOV D,M
	   MOV M,A
	   DCX H
	   MOV M,D
	   INX H

NOSWAP:	   DCR B
	   JNZ LOOP
	   DCR C
	   JNZ RELOOP
	   HLT

Assuming you have put some numbers consecutively in memory, in my case it was
01 05 03 02 04
starting at 2201H.
The CMP does not raise the carry flag.

Requested Feature: Dec to Hex converter

Problem Statement

When we give any address to store the value at some memory location say STA 2300 then the data will be stored in memory location Hex equivalent of 2300, i.e 08FC, which is good, but to search for every result as a user, I would need to look after each hex equivalent of assigned decimal location,and have to manually calculate the equivalent or use any third app to search equivalent number and then search in memory table

Solution I Suggest

I suggest we can add one small input field to convert Decimal value given by user to convert it into hex in app itself so that no individual have to look after some additional app for that conversion. It would help user in finding up the location of memory where their data are stored and see the desired output

[FEATURE REQUEST]Support for OUT command

I think we should add in a 'OUT' command to display the data of the accumulator onto a seven segment display. We will also need to simulate a SSD in the process If you think this feature is okay, should I start working on it? :)

infinite loop on my code

I've been working on a school project for my computer architecture class where we have to write an assembly code in 8085 that computes the power of a number B by a number C. To be honest, we don't reaaally know what we are doing since it's our first time having any contact with Assmebly... in a few days we will have to hand in our projects, but we ran it on this site and it says we have an INFINITE LOOP! If somebody could tell me how to fix the issue with the code we would REALLY appreciate it!! Thank you very much and have a nice day :)

note: the register 00E0 is where we store the value of C, and the register 00E1 is where we store the value of B

;

jmp start

;data

;code

start: nop

LDA 00E0
MOV C, A
MVI A, 00
CMP C
JZ 0028
LDA 00E1
MOV B, A
MVI A, 00
CMP B
JZ 002D
MVI HL, 01

MOV E, B
MVI A, 00

ADD D
JC 002D
DCR E
JNZ 0019
MOV D, A
DCR C
JNZ 0016
MOV A, D

HLT

MVI A, 01
JMP 0027

MVI A, 00
JMP 0027

HLT

[BUG] Program couldn't be assembled and compiled

Consider the program for adding consecutive numbers.
If the result doesn't produce carry -> Display result through the OUT port.
Else display 01 thru OUT port.

        LXI H, 00F0H        ; Initialize HL pair to point to memory location 00F0H
        MVI C, 05H          ; Initialize byte counter to 5
        SUB A               ; Clear the accumulator (A = 0)

NEXT:   ADD M               ; Add the byte at memory location pointed to by HL to A
        JC STOP             ; If carry is generated, jump to STOP
        INX H               ; Increment HL to point to the next memory location
        DCR C               ; Decrement byte counter
        JNZ NEXT            ; If byte counter is not zero, repeat the loop
        OUT 00H             ; Output the sum to the output port (assuming port address is D8H)
        HLT                 ; Halt the program

STOP:   MVI A, 01H          ; Load 01H into A to indicate carry was generated
        OUT 00H             ; Output 01H to the output port (assuming port address is D8H)
        HLT                 ; Halt the program

This couldn't be assembled and compiled.
Error shown:

 Label STOP is not defined. Also check the label definition, there may be some issues on that line.

Image for reference:
image

PS: The program successfully executed on GNUSim8085

cnz not working

EDIT: I realize that my code may not be valid, I apologize in advance if this is so

jmp start

start: nop
mvi b,88h
mov a,b
cnz functionname
hlt

functionname: mov c,a
ret

When going through line-by-line, instead of calling functionname subroutine, the instruction will jump to line 1. However, when you change "cnz" to "call", it will work properly.

Infinite loop error

;

jmp start

;data

;code
start: nop
LXI H,0000H
MVI A,00H
MVI C,09H
LABEL:nop
MVI B,FFH
L1: MVI D,FFH
L2: DCR D
JNZ L2
DCR B
JNZ L1
ADI 01H
MOV M,A
INX H
MOV A,L
DCR C
JNZ LABEL
HLT

Unexpected behavior by the JNC statement

MVI C, 00H
LXI H, 28E0H
MOV B, M
INX H
MOV A, M
ADD B
JNC 080DH
INR C
INX H
MOV M, A
INX H
MOV M, C
HLT

It's a simple adder which stores carry too. So, when I run it, there are two ways this program goes depending on the values to be added (at memory location 28E0H and 28E1H).
If the sum generates a carry, it works perfectly, but if it doesn't generate a carry, program doesn't run and says infinite loop detected. I tried to debug it by using the "Run one instruction" and it turns out JNC carry statement doesn't work like it should. That is, instead of setting PC register to 080DH, it sets it to 100DH.

Decimal adjustment (DAA) result error

It adds 06 to any numbers (i.e. although the number is less than 0xA) to adjust decimal using DAA after once DAA executed for number greater than 0x9.

Infinite loop error

LXI H, 4150
MOV B, M
MVI C, 00
INX H
MOV A, M
NEXT: CMP B
JC LOOP
SUB B
INR C
JMP NEXT
LOOP: STA 4152
MOV A, C
STA 4153

call, ret not working

Hello, thanks for fixing the jz problem. Sorry to bother you again, but the call/ret sequence doesn't seem to work either; could you look into this?
Your compiler has quite a good ui and is easy to use, so I dont want to use any other simulator if possible. Thanks again.

Program:

mvi a, 0ah
mvi b, 1ch
call adsbr
sta 0100h
hlt

adsbr: add b
ret

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.