Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Assembly in C Emu8086 branch table

Assembly in C Emu8086 branch table

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a random user
    wrote on last edited by
    #1

    Hello there, Im trying to make an assembly program that translates a simple switch case program in c without using and commands related to jg or jt only jmp I tried making something like this: org 100h mov si,3 jmp word ptr [jmptab+si] case1: PRINTN "Number One" jmp endcases case2: PRINTN "Number Two" jmp endcases case3: PRINTN "Number Three" jmp endcases case4: PRINTN "Number Four" endcases: jmptab: DW case1 DW case2 DW case3 DW case4 mov ah, 0 int 16h ret include magshimim.inc Where did I go wrong?

    D 1 Reply Last reply
    0
    • A a random user

      Hello there, Im trying to make an assembly program that translates a simple switch case program in c without using and commands related to jg or jt only jmp I tried making something like this: org 100h mov si,3 jmp word ptr [jmptab+si] case1: PRINTN "Number One" jmp endcases case2: PRINTN "Number Two" jmp endcases case3: PRINTN "Number Three" jmp endcases case4: PRINTN "Number Four" endcases: jmptab: DW case1 DW case2 DW case3 DW case4 mov ah, 0 int 16h ret include magshimim.inc Where did I go wrong?

      D Offline
      D Offline
      Daniel Pfeffer
      wrote on last edited by
      #2

      [This should really go in QA] Hint: a. What is the size of each entry in your jump table? b. How are you indexing the jump table?

      If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups