<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Cygwin help in Operating System - Microsoft</title>
    <link>https://community.hpe.com/t5/operating-system-microsoft/cygwin-help/m-p/3925193#M7749</link>
    <description>well i am stuck on a problem involving cygwin. i am to create a program which is to&lt;BR /&gt;run  from the command prompt.  A buffer should be declared which will hold a character string of an appropriate length  (say 80 characters). A menu of options is to be displayed indicating the choices shown below.  The user can then enter an option letter between a-d inclusive. The option letter is processed as follows:&lt;BR /&gt;&lt;BR /&gt;Option a - enter a string into buffer.&lt;BR /&gt;Option b - display string to the screen.&lt;BR /&gt;Option c - encode/decode string using rot13 algorithm.&lt;BR /&gt;Option d - program exits.&lt;BR /&gt; &lt;BR /&gt;To read and write characters, you should only make use of the system calls getchar and putchar respectively. To perform the encoding/decoding you should make use of the rot13 subroutine supplied below.&lt;BR /&gt;&lt;BR /&gt;rot13:&lt;BR /&gt;       # ls byte of edx contains value to be en/decoded&lt;BR /&gt;       # if char &amp;gt;= 0x41 &amp;amp;&amp;amp; char &amp;lt;= 0x5a then uppercase&lt;BR /&gt;       # if (char+13) &amp;gt; 0x5a then subtract 26&lt;BR /&gt;       # if char &amp;gt;= 0x61 &amp;amp;&amp;amp; char &amp;lt;= 0x7a then lowercase&lt;BR /&gt;       # if (char+13) &amp;gt; 0x7a then subtract 26&lt;BR /&gt;       #&lt;BR /&gt;       cmpb dl, 0x41&lt;BR /&gt;       jl r13l2&lt;BR /&gt;       cmpb dl, 0x5a&lt;BR /&gt;       ja r13l2&lt;BR /&gt;       # uppercase&lt;BR /&gt;       addb dl, 13&lt;BR /&gt;       cmpb dl, 0x5a&lt;BR /&gt;       jle r13l1&lt;BR /&gt;       subb dl, 26&lt;BR /&gt;r13l1: jmp r13le&lt;BR /&gt;r13l2: cmpb dl, 0x61&lt;BR /&gt;       jl r13le&lt;BR /&gt;       cmpb dl, 0x7a&lt;BR /&gt;       ja r13le&lt;BR /&gt;       # lowercase&lt;BR /&gt;       addb dl, 13&lt;BR /&gt;       cmpb dl, 0x7a&lt;BR /&gt;       jbe r13le       # b not l, ignore sign bit!&lt;BR /&gt;       subb dl, 26&lt;BR /&gt;r13le: ret&lt;BR /&gt;   &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For assistance i have made a few templatles to start off with but am stuck on it. the templates are as follows:&lt;BR /&gt;1.&lt;BR /&gt;Template for IA-32 assembly language programs &lt;BR /&gt;# comments start with # in column 1&lt;BR /&gt;# commands which start with a . (dot) are assembler directives&lt;BR /&gt;# which do not generate machine code&lt;BR /&gt;.intel_syntax noprefix&lt;BR /&gt;.global _main&lt;BR /&gt;&lt;BR /&gt;# put external (system) calls here&lt;BR /&gt;.extern _exit &lt;BR /&gt;.extern _getchar&lt;BR /&gt;.extern _putchar&lt;BR /&gt;&lt;BR /&gt;.data&lt;BR /&gt;# declare variables here  &lt;BR /&gt;&lt;BR /&gt;.text&lt;BR /&gt;_main:&lt;BR /&gt;# main program code goes here ...&lt;BR /&gt;&lt;BR /&gt;# for example, a program which adds the values in eax and ebx, stores&lt;BR /&gt;# sum in eax&lt;BR /&gt;&lt;BR /&gt;        mov eax, 3&lt;BR /&gt;        mov ebx, 5&lt;BR /&gt;        add eax, ebx&lt;BR /&gt;&lt;BR /&gt;# programs always end with ... &lt;BR /&gt;&lt;BR /&gt;        mov eax, 0&lt;BR /&gt;        call _exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# user-defined subroutines(methods) go here ...&lt;BR /&gt;&lt;BR /&gt;# end of program&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2.&lt;BR /&gt;Program to write two strings, each separated by a newline &lt;BR /&gt;Without using user-defined subroutines &lt;BR /&gt;&lt;BR /&gt;.data &lt;BR /&gt;s1: .byte  'm','e','s','s','a','g','e','A',0&lt;BR /&gt;s2: .byte  'm','e','s','s','a','g','e','B',0&lt;BR /&gt; &lt;BR /&gt;.text&lt;BR /&gt;_main:&lt;BR /&gt;&lt;BR /&gt;        lea ebx, s1&lt;BR /&gt;wrstr1:                     # ebx contains string pointed to&lt;BR /&gt;        mov al, [ebx]       # get character&lt;BR /&gt;wh1:    &lt;BR /&gt;        cmp al, 0 &lt;BR /&gt;        je whe1             # jump if al == 0&lt;BR /&gt;whd1:&lt;BR /&gt;        push ebx&lt;BR /&gt;        push eax&lt;BR /&gt;        call _putchar       # display on screen&lt;BR /&gt;        add esp, 4&lt;BR /&gt;        pop ebx&lt;BR /&gt;        inc ebx             # ebx points to next char&lt;BR /&gt;        mov al, [ebx]       # get character&lt;BR /&gt;        jmp wh1 &lt;BR /&gt;whe1:&lt;BR /&gt; mov al, 10          # newline &lt;BR /&gt; push eax&lt;BR /&gt; call _putchar&lt;BR /&gt; add esp,4&lt;BR /&gt;&lt;BR /&gt;        &lt;BR /&gt; &lt;BR /&gt;        lea ebx, s2 &lt;BR /&gt;&lt;BR /&gt;wrstr2:                     # ebx contains string pointed to&lt;BR /&gt;        mov al, [ebx]       # get character&lt;BR /&gt;wh2:    &lt;BR /&gt;        cmp al, 0 &lt;BR /&gt;        je whe2             # jump if al == 0&lt;BR /&gt;whd2:&lt;BR /&gt;        push ebx&lt;BR /&gt;        push eax&lt;BR /&gt;        call _putchar       # display on screen&lt;BR /&gt;        add esp, 4&lt;BR /&gt;        pop ebx&lt;BR /&gt;        inc ebx             # ebx points to next char&lt;BR /&gt;        mov al, [ebx]       # get character&lt;BR /&gt;        jmp wh2 &lt;BR /&gt;whe2:&lt;BR /&gt;        mov al, 10          # newline &lt;BR /&gt; push eax&lt;BR /&gt; call _putchar&lt;BR /&gt; add esp,4&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;        mov eax, 0          # exit &lt;BR /&gt;        push eax&lt;BR /&gt;        call _exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3. &lt;BR /&gt;Example of input character routine &lt;BR /&gt;Pseudo code &lt;BR /&gt;        declare data buffer&lt;BR /&gt;&lt;BR /&gt;        set pointer to (1st byte of) buffer&lt;BR /&gt;        input a char&lt;BR /&gt;        while not enter(LF) pressed do&lt;BR /&gt;            store in buffer&lt;BR /&gt;            increment pointer to next byte of buffer&lt;BR /&gt;            input next char&lt;BR /&gt;        end&lt;BR /&gt;        add null char to define end of string&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;4.&lt;BR /&gt;Assembly language &lt;BR /&gt;.data &lt;BR /&gt;buffer1: .rept 80 # reserve 80 bytes in memory &lt;BR /&gt;         .byte 0&lt;BR /&gt;         .endr&lt;BR /&gt;&lt;BR /&gt;.text   &lt;BR /&gt;_main:                    &lt;BR /&gt;        lea ebx, buffer1&lt;BR /&gt;        push ebx&lt;BR /&gt;        call _getchar  # input char&lt;BR /&gt;                       # char returned in al&lt;BR /&gt;        pop ebx&lt;BR /&gt; &lt;BR /&gt;wh1:    &lt;BR /&gt;        cmp al, 0x0a   # while not LF do&lt;BR /&gt;        je end1        # &lt;BR /&gt;whd1:    &lt;BR /&gt;        movb [ebx], al # note movb (see note)&lt;BR /&gt;        inc ebx&lt;BR /&gt;        push ebx       # point to next location&lt;BR /&gt;        call _getchar  # input char&lt;BR /&gt;                       # char returned in al&lt;BR /&gt;        pop ebx&lt;BR /&gt;        jmp wh1 &lt;BR /&gt;end1:   &lt;BR /&gt;        movb [ebx], 0  # make string null terminated, movb again&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So can anyone help me with this??&lt;BR /&gt;</description>
    <pubDate>Fri, 12 Jan 2007 04:23:09 GMT</pubDate>
    <dc:creator>slider_1</dc:creator>
    <dc:date>2007-01-12T04:23:09Z</dc:date>
    <item>
      <title>Cygwin help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/cygwin-help/m-p/3925193#M7749</link>
      <description>well i am stuck on a problem involving cygwin. i am to create a program which is to&lt;BR /&gt;run  from the command prompt.  A buffer should be declared which will hold a character string of an appropriate length  (say 80 characters). A menu of options is to be displayed indicating the choices shown below.  The user can then enter an option letter between a-d inclusive. The option letter is processed as follows:&lt;BR /&gt;&lt;BR /&gt;Option a - enter a string into buffer.&lt;BR /&gt;Option b - display string to the screen.&lt;BR /&gt;Option c - encode/decode string using rot13 algorithm.&lt;BR /&gt;Option d - program exits.&lt;BR /&gt; &lt;BR /&gt;To read and write characters, you should only make use of the system calls getchar and putchar respectively. To perform the encoding/decoding you should make use of the rot13 subroutine supplied below.&lt;BR /&gt;&lt;BR /&gt;rot13:&lt;BR /&gt;       # ls byte of edx contains value to be en/decoded&lt;BR /&gt;       # if char &amp;gt;= 0x41 &amp;amp;&amp;amp; char &amp;lt;= 0x5a then uppercase&lt;BR /&gt;       # if (char+13) &amp;gt; 0x5a then subtract 26&lt;BR /&gt;       # if char &amp;gt;= 0x61 &amp;amp;&amp;amp; char &amp;lt;= 0x7a then lowercase&lt;BR /&gt;       # if (char+13) &amp;gt; 0x7a then subtract 26&lt;BR /&gt;       #&lt;BR /&gt;       cmpb dl, 0x41&lt;BR /&gt;       jl r13l2&lt;BR /&gt;       cmpb dl, 0x5a&lt;BR /&gt;       ja r13l2&lt;BR /&gt;       # uppercase&lt;BR /&gt;       addb dl, 13&lt;BR /&gt;       cmpb dl, 0x5a&lt;BR /&gt;       jle r13l1&lt;BR /&gt;       subb dl, 26&lt;BR /&gt;r13l1: jmp r13le&lt;BR /&gt;r13l2: cmpb dl, 0x61&lt;BR /&gt;       jl r13le&lt;BR /&gt;       cmpb dl, 0x7a&lt;BR /&gt;       ja r13le&lt;BR /&gt;       # lowercase&lt;BR /&gt;       addb dl, 13&lt;BR /&gt;       cmpb dl, 0x7a&lt;BR /&gt;       jbe r13le       # b not l, ignore sign bit!&lt;BR /&gt;       subb dl, 26&lt;BR /&gt;r13le: ret&lt;BR /&gt;   &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For assistance i have made a few templatles to start off with but am stuck on it. the templates are as follows:&lt;BR /&gt;1.&lt;BR /&gt;Template for IA-32 assembly language programs &lt;BR /&gt;# comments start with # in column 1&lt;BR /&gt;# commands which start with a . (dot) are assembler directives&lt;BR /&gt;# which do not generate machine code&lt;BR /&gt;.intel_syntax noprefix&lt;BR /&gt;.global _main&lt;BR /&gt;&lt;BR /&gt;# put external (system) calls here&lt;BR /&gt;.extern _exit &lt;BR /&gt;.extern _getchar&lt;BR /&gt;.extern _putchar&lt;BR /&gt;&lt;BR /&gt;.data&lt;BR /&gt;# declare variables here  &lt;BR /&gt;&lt;BR /&gt;.text&lt;BR /&gt;_main:&lt;BR /&gt;# main program code goes here ...&lt;BR /&gt;&lt;BR /&gt;# for example, a program which adds the values in eax and ebx, stores&lt;BR /&gt;# sum in eax&lt;BR /&gt;&lt;BR /&gt;        mov eax, 3&lt;BR /&gt;        mov ebx, 5&lt;BR /&gt;        add eax, ebx&lt;BR /&gt;&lt;BR /&gt;# programs always end with ... &lt;BR /&gt;&lt;BR /&gt;        mov eax, 0&lt;BR /&gt;        call _exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# user-defined subroutines(methods) go here ...&lt;BR /&gt;&lt;BR /&gt;# end of program&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2.&lt;BR /&gt;Program to write two strings, each separated by a newline &lt;BR /&gt;Without using user-defined subroutines &lt;BR /&gt;&lt;BR /&gt;.data &lt;BR /&gt;s1: .byte  'm','e','s','s','a','g','e','A',0&lt;BR /&gt;s2: .byte  'm','e','s','s','a','g','e','B',0&lt;BR /&gt; &lt;BR /&gt;.text&lt;BR /&gt;_main:&lt;BR /&gt;&lt;BR /&gt;        lea ebx, s1&lt;BR /&gt;wrstr1:                     # ebx contains string pointed to&lt;BR /&gt;        mov al, [ebx]       # get character&lt;BR /&gt;wh1:    &lt;BR /&gt;        cmp al, 0 &lt;BR /&gt;        je whe1             # jump if al == 0&lt;BR /&gt;whd1:&lt;BR /&gt;        push ebx&lt;BR /&gt;        push eax&lt;BR /&gt;        call _putchar       # display on screen&lt;BR /&gt;        add esp, 4&lt;BR /&gt;        pop ebx&lt;BR /&gt;        inc ebx             # ebx points to next char&lt;BR /&gt;        mov al, [ebx]       # get character&lt;BR /&gt;        jmp wh1 &lt;BR /&gt;whe1:&lt;BR /&gt; mov al, 10          # newline &lt;BR /&gt; push eax&lt;BR /&gt; call _putchar&lt;BR /&gt; add esp,4&lt;BR /&gt;&lt;BR /&gt;        &lt;BR /&gt; &lt;BR /&gt;        lea ebx, s2 &lt;BR /&gt;&lt;BR /&gt;wrstr2:                     # ebx contains string pointed to&lt;BR /&gt;        mov al, [ebx]       # get character&lt;BR /&gt;wh2:    &lt;BR /&gt;        cmp al, 0 &lt;BR /&gt;        je whe2             # jump if al == 0&lt;BR /&gt;whd2:&lt;BR /&gt;        push ebx&lt;BR /&gt;        push eax&lt;BR /&gt;        call _putchar       # display on screen&lt;BR /&gt;        add esp, 4&lt;BR /&gt;        pop ebx&lt;BR /&gt;        inc ebx             # ebx points to next char&lt;BR /&gt;        mov al, [ebx]       # get character&lt;BR /&gt;        jmp wh2 &lt;BR /&gt;whe2:&lt;BR /&gt;        mov al, 10          # newline &lt;BR /&gt; push eax&lt;BR /&gt; call _putchar&lt;BR /&gt; add esp,4&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;        mov eax, 0          # exit &lt;BR /&gt;        push eax&lt;BR /&gt;        call _exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3. &lt;BR /&gt;Example of input character routine &lt;BR /&gt;Pseudo code &lt;BR /&gt;        declare data buffer&lt;BR /&gt;&lt;BR /&gt;        set pointer to (1st byte of) buffer&lt;BR /&gt;        input a char&lt;BR /&gt;        while not enter(LF) pressed do&lt;BR /&gt;            store in buffer&lt;BR /&gt;            increment pointer to next byte of buffer&lt;BR /&gt;            input next char&lt;BR /&gt;        end&lt;BR /&gt;        add null char to define end of string&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;4.&lt;BR /&gt;Assembly language &lt;BR /&gt;.data &lt;BR /&gt;buffer1: .rept 80 # reserve 80 bytes in memory &lt;BR /&gt;         .byte 0&lt;BR /&gt;         .endr&lt;BR /&gt;&lt;BR /&gt;.text   &lt;BR /&gt;_main:                    &lt;BR /&gt;        lea ebx, buffer1&lt;BR /&gt;        push ebx&lt;BR /&gt;        call _getchar  # input char&lt;BR /&gt;                       # char returned in al&lt;BR /&gt;        pop ebx&lt;BR /&gt; &lt;BR /&gt;wh1:    &lt;BR /&gt;        cmp al, 0x0a   # while not LF do&lt;BR /&gt;        je end1        # &lt;BR /&gt;whd1:    &lt;BR /&gt;        movb [ebx], al # note movb (see note)&lt;BR /&gt;        inc ebx&lt;BR /&gt;        push ebx       # point to next location&lt;BR /&gt;        call _getchar  # input char&lt;BR /&gt;                       # char returned in al&lt;BR /&gt;        pop ebx&lt;BR /&gt;        jmp wh1 &lt;BR /&gt;end1:   &lt;BR /&gt;        movb [ebx], 0  # make string null terminated, movb again&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So can anyone help me with this??&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jan 2007 04:23:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/cygwin-help/m-p/3925193#M7749</guid>
      <dc:creator>slider_1</dc:creator>
      <dc:date>2007-01-12T04:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cygwin help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/cygwin-help/m-p/3925194#M7750</link>
      <description>I am confused as to how this relates to help with cygwin. Looks as if you are asking for help with assembly.</description>
      <pubDate>Thu, 21 Jun 2007 11:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/cygwin-help/m-p/3925194#M7750</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2007-06-21T11:14:16Z</dc:date>
    </item>
  </channel>
</rss>

