Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7867095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:36:57+00:00 2026-06-03T00:36:57+00:00

I just want too write simple .asm code for TASM that work as for

  • 0

I just want too write simple .asm code for TASM that work as for in C++

int t=2;
for(int i=0;i<2;i++)
t=t+(i-1)*7*t;

How can I implement it with TASM?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:36:59+00:00Added an answer on June 3, 2026 at 12:36 am

    This will loop from 1 to 100 in 8086 TASM:

        .MODEL SMALL
    
        .STACK 100h
    
        .DATA   
        Finished DB 10, 13, 'Loop x 100 finished.  Congratulations! $', 10, 13
    
        .CODE
    
        MAIN PROC
    
                MOV AX, @data            ; Required at the start of every program (inside your main procedure, from what I've seen)
                MOV DS, AX
    
                MOV CX, 100              ; Set CX to 100
                MOV BX, 0                ; Counter (for double-verification, I guess...lol)
    
        StrtLoop:                        ; When a loop starts, it does CX-- (subtracts 1 from CX)   
    
                INC BX                    ; This does BX++, which increments BX by 1
    
        LOOP StrtLoop                     ; Go back to StrtLoop label
    
                CMP BX, 100              ; Compare BX to 100...
                JE DispMsg               ; Jump-if-Equal...CMP BX, 100 sets flags, and if they are set,
                                         ;  JE will Jump you to DispMsg (to get "congratulations" message).
    
                JMP SkipMsg              ; Jump to the SkipMsg label (so you don't see the "congratulations" message).
    
        DispMsg:                         ; If BX = 100, you JE here.
                MOV AH, 09H              ; Displays the message stored in the defined byte "Finished"
                MOV DX, OFFSET Finished
                INT 21H
        SkipMsg:                         ; If BX != 100, you JMP here.
                MOV AL, 0h               ; Op code to exit to DOS from the assembler.
                MOV AH, 4CH
                INT 21H
    
        MAIN ENDP
        END MAIN
    

    I hope it helps. I did the basic loop, so you can do the other bits of your code (and I don’t know C++, lol). Good luck! It’s hard, but kind of fun at the same time (at least for me).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I want to write an AJAX chat box, just something simple, I
Instead of writing too many sql statements in each servlet I just want to
I don't know too much about encryption, I just want to ask, which method
Just want to ask can netbean IDE get connected to clearcase remote client server
I just want to know: How can I delete 'log.txt' if the last modification
For a computer architecture project I want to write some bootable code to do
So basically I just want to debug a couple of simple scripts by trying
I'd like to write a simple wrapper for the python list type that forces
I basically use vim to write some simple C# code snippets. Visual Studio is
I want to create a calendar in my application that external users can view.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.